comparison gcc/testsuite/g++.dg/diagnostic/enum1.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 // PR c++/92974 - bogus location for enum and non-enum in ?: warning.
2 // { dg-options "-Wextra" }
3
4 enum { X };
5
6 struct S {
7 template <typename T>
8 void f(T) { unsigned int g(X ?: g); } // { dg-warning "enumerated and non-enumerated type in conditional expression" }
9 };
10
11 struct S2 {
12 S m;
13 void l() { m.f(1); }
14 };