145
|
1 /* Verify that warnings about member initializers appear at the bad value,
|
|
2 rather than on the last token of the final initializer. */
|
|
3
|
|
4 // { dg-do compile }
|
|
5 // { dg-options "-Wconversion-null -fdiagnostics-show-caret" }
|
|
6
|
|
7 #define NULL ((void *)0) // { dg-error "invalid conversion from 'void\\*' to 'int'" }
|
|
8 /* { dg-begin-multiline-output "" }
|
|
9 #define NULL ((void *)0)
|
|
10 ~^~~~~~~~~~
|
|
11 |
|
|
12 void*
|
|
13 { dg-end-multiline-output "" } */
|
|
14
|
|
15 class A
|
|
16 {
|
|
17 public:
|
|
18 A();
|
|
19 bool m_bool;
|
|
20 int m_int;
|
|
21 void *m_ptr;
|
|
22 };
|
|
23
|
|
24 A::A()
|
|
25 : m_bool(NULL),
|
|
26 m_int(NULL), // { dg-message "in expansion of macro 'NULL'" }
|
|
27 m_ptr(NULL)
|
|
28 {
|
|
29 }
|
|
30
|
|
31 /* { dg-begin-multiline-output "" }
|
|
32 m_int(NULL),
|
|
33 ^~~~
|
|
34 { dg-end-multiline-output "" } */
|