Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/warn/pr94038.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 template<typename T> | |
6 constexpr int | |
7 foo() | |
8 { | |
9 static_assert(T(1) == 0, ""); | |
10 return 0; | |
11 } | |
12 | |
13 template<typename T> | |
14 constexpr int | |
15 bar() | |
16 { | |
17 return foo<T>(); | |
18 } | |
19 | |
20 constexpr int | |
21 baz(int a) | |
22 { | |
23 return a; | |
24 } | |
25 | |
26 static_assert(decltype(baz(bar<int>())){} == 0, ""); |