Debian Codegraph @

gcc/testsuite/g++.dg/diagnostic/alignof4.C

raw
1 // PR c++/85979
2 // { dg-do compile { target c++11 } }
3
4 template<int N> struct A { };
5
6 template<class T>
7 void f(A<alignof(T)>) { }
8
9 #if __cpp_concepts
10 template<class T>
11 void g() requires (alignof(T) == 0);
12 #endif
13
14 int main() {
15 f<int>(); // { dg-error "no match" }
16 #if __cpp_concepts
17 g<int>(); // { dg-error "no match" "" { target c++20 } }
18 #endif
19 }
20
21 // { dg-bogus "__alignof__" "" { target *-*-* } 0 }