OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wconversion-null-2.C] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do link  }
2
// { dg-options "" }
3
 
4
#include 
5
 
6
void g(int) {}
7
void g(long) {}
8
void g(long long) {}
9
extern void g(void*);
10
 
11
template 
12
void h() {}
13
 
14
void k(int) {}
15
 
16
template 
17
void l(T);
18
 
19
template <>
20
void l(int) {}
21
 
22
template <>
23
void l(long) {}
24
 
25
template <>
26
void l(long long) {}
27
 
28
int main()
29
{
30
  int i = NULL; // { dg-warning "" } converting NULL to non-pointer type
31
  float z = NULL; // { dg-warning "" } converting NULL to non-pointer type
32
  int a[2];
33
 
34
  i != NULL; // { dg-warning "" } NULL used in arithmetic
35
  NULL != z; // { dg-warning "" } NULL used in arithmetic
36
  k != NULL; // No warning: decay conversion
37
  NULL != a; // Likewise.
38
  -NULL;     // { dg-warning "" } converting NULL to non-pointer type
39
  +NULL;     // { dg-warning "" } converting NULL to non-pointer type
40
  ~NULL;     // { dg-warning "" } converting NULL to non-pointer type
41
  a[NULL] = 3; // { dg-warning "" } converting NULL to non-pointer-type
42
  i = NULL;  // { dg-warning "" } converting NULL to non-pointer type
43
  z = NULL;  // { dg-warning "" } converting NULL to non-pointer type
44
  k(NULL);   // { dg-warning "" } converting NULL to int
45
  g(NULL);   // { dg-warning "" } converting NULL to int
46
  h(); // No warning: NULL bound to integer template parameter
47
  l(NULL);   // No warning: NULL is used to implicitly instantiate the template
48
  NULL && NULL; // No warning: converting NULL to bool is OK
49
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.