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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wconversion-null.C] - Blame information for rev 783

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do link  }
2
// { dg-options "-Wconversion -Wno-conversion-null -Wno-pointer-arith" }
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; //  converting NULL to non-pointer type
31
  float z = NULL; //  converting NULL to non-pointer type
32
  int a[2];
33
 
34
  i != NULL; //  NULL used in arithmetic
35
  NULL != z; //  NULL used in arithmetic
36
  k != NULL; // No warning: decay conversion
37
  NULL != a; // Likewise.
38
  -NULL;     //  converting NULL to non-pointer type
39
  +NULL;     //  converting NULL to non-pointer type
40
  ~NULL;     //  converting NULL to non-pointer type
41
  a[NULL] = 3; //  converting NULL to non-pointer-type
42
  i = NULL;  //  converting NULL to non-pointer type
43
  z = NULL;  //  converting NULL to non-pointer type
44
  k(NULL);   //  converting NULL to int
45
  g(NULL);   //  converting NULL to int
46
  h(); // No warning: NULL bound to integer template parameter
47
  l(NULL);   //  converting NULL to int
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.