2020-03-27 16:21:36 +01:00
|
|
|
// RUN: %clang_cc1 -verify -fsyntax-only -fno-recovery-ast %s
|
|
|
|
// RUN: %clang_cc1 -verify -fsyntax-only -frecovery-ast %s
|
|
|
|
|
|
|
|
void foo(); // expected-note 2{{requires 0 arguments}}
|
2020-03-26 18:42:40 +01:00
|
|
|
class X {
|
|
|
|
decltype(foo(42)) invalid; // expected-error {{no matching function}}
|
|
|
|
};
|
|
|
|
// Should be able to evaluate sizeof without crashing.
|
|
|
|
static_assert(sizeof(X) == 1, "No valid members");
|
2020-03-27 16:21:36 +01:00
|
|
|
|
|
|
|
class Y {
|
|
|
|
typeof(foo(42)) invalid; // expected-error {{no matching function}}
|
|
|
|
};
|
|
|
|
// Should be able to evaluate sizeof without crashing.
|
|
|
|
static_assert(sizeof(Y) == 1, "No valid members");
|
2020-06-16 09:25:17 +02:00
|
|
|
|
|
|
|
class Z {
|
|
|
|
int array[sizeof(invalid())]; // expected-error {{use of undeclared identifier}}
|
|
|
|
};
|
|
|
|
// Should be able to evaluate sizeof without crashing.
|
|
|
|
static_assert(sizeof(Z) == 1, "No valid members");
|
2020-10-05 10:35:29 +02:00
|
|
|
|
|
|
|
constexpr int N = undef; // expected-error {{use of undeclared identifier}}
|
|
|
|
template<int a>
|
|
|
|
class ABC {};
|
|
|
|
class T {
|
|
|
|
ABC<N> abc;
|
|
|
|
};
|
|
|
|
static_assert(sizeof(T) == 1, "No valid members");
|