Debian Codegraph @

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

raw
1 // PR c++/101906
2 // Verify the template arguments of an alias template-id are evaluated even
3 // in an unevaluated context.
4 // { dg-do compile { target c++11 } }
5
6 template<int, class T> using skip = T;
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), "");