Debian Codegraph @

gcc/testsuite/g++.dg/template/evaluated1b.C

raw
1 // PR c++/101906
2 // Like unevaluated1.C, but using a function template instead of an
3 // alias template.
4 // { dg-do compile { target c++14 } }
5
6 template<int, class T> T skip();
7
8 template<class T>
9 constexpr unsigned sizeof_() {
10 return sizeof(skip<(T(), 0), T>());
11 }
12
13 struct A {
14 int m = -1;
15 };
16
17 static_assert(sizeof_<A>() == sizeof(A), "");