comparison clang/test/Sema/invalid-member.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 0572611fdcc8
children
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
11 class Y { 11 class Y {
12 typeof(foo(42)) invalid; // expected-error {{no matching function}} 12 typeof(foo(42)) invalid; // expected-error {{no matching function}}
13 }; 13 };
14 // Should be able to evaluate sizeof without crashing. 14 // Should be able to evaluate sizeof without crashing.
15 static_assert(sizeof(Y) == 1, "No valid members"); 15 static_assert(sizeof(Y) == 1, "No valid members");
16
17 class Z {
18 int array[sizeof(invalid())]; // expected-error {{use of undeclared identifier}}
19 };
20 // Should be able to evaluate sizeof without crashing.
21 static_assert(sizeof(Z) == 1, "No valid members");
22
23 constexpr int N = undef; // expected-error {{use of undeclared identifier}}
24 template<int a>
25 class ABC {};
26 class T {
27 ABC<N> abc;
28 };
29 static_assert(sizeof(T) == 1, "No valid members");