repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Daily bump.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
pr94038-2.C
blob
a468cc055ebf6343a713f450a1eb81e7c8356c7e
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, "");