comparison gcc/testsuite/g++.dg/warn/pr94038-2.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 // PR c++/94038
2 // { dg-do compile { target c++11 } }
3 // { dg-additional-options "-O -Wall" }
4
5 static constexpr int x = 0;
6
7 template<typename T>
8 constexpr const int&
9 foo()
10 {
11 static_assert(T(1) == 0, "");
12 return x;
13 }
14
15 template<typename T>
16 constexpr const int&
17 bar()
18 {
19 return foo<T>();
20 }
21
22 constexpr int
23 baz(int a)
24 {
25 return a;
26 }
27
28 static_assert(decltype(baz(bar<int>())){} == 0, "");