gcc/testsuite/g++.dg/warn/Wuninitializable-member-no.C
raw| 1 | // Test disabling |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-Wall -Wextra -Wno-uninitialized" } |
| 4 | |
| 5 | class X { |
| 6 | int & flag;// { dg-bogus "non-static reference 'int& X::flag' in class without a constructor" } |
| 7 | public: |
| 8 | void f(){ flag++ ; } |
| 9 | }; |
| 10 | |
| 11 | class Y { |
| 12 | const int var;// { dg-bogus "non-static const member 'const int Y::var' in class without a constructor" } |
| 13 | public: |
| 14 | int g(){ return 2*var; } |
| 15 | }; |