Debian Codegraph @

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

raw
1 // PR c++/101906
2 // Like unevaluated1b.C, but using a variable template instead of a
3 // function 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), "");