comparison gcc/testsuite/g++.dg/init/pr43064-2.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
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 "" } */