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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wconversion-null.C] - Blame information for rev 301

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 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
extern void g(void*);
9
 
10
template 
11
void h() {}
12
 
13
void k(int) {}
14
 
15
template 
16
void l(T);
17
 
18
template <>
19
void l(int) {}
20
 
21
template <>
22
void l(long) {}
23
 
24
int main()
25
{
26
  int i = NULL; //  converting NULL to non-pointer type
27
  float z = NULL; //  converting NULL to non-pointer type
28
  int a[2];
29
 
30
  i != NULL; //  NULL used in arithmetic
31
  NULL != z; //  NULL used in arithmetic
32
  k != NULL; // No warning: decay conversion
33
  NULL != a; // Likewise.
34
  -NULL;     //  converting NULL to non-pointer type
35
  +NULL;     //  converting NULL to non-pointer type
36
  ~NULL;     //  converting NULL to non-pointer type
37
  a[NULL] = 3; //  converting NULL to non-pointer-type
38
  i = NULL;  //  converting NULL to non-pointer type
39
  z = NULL;  //  converting NULL to non-pointer type
40
  k(NULL);   //  converting NULL to int
41
  g(NULL);   //  converting NULL to int
42
  h(); // No warning: NULL bound to integer template parameter
43
  l(NULL);   //  converting NULL to int
44
  NULL && NULL; // No warning: converting NULL to bool is OK
45
}

powered by: WebSVN 2.1.0

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