blob: 201ab03955cd5c5469f2ec59b6f13c8be171930e [file] [log] [blame]
Erich Keane0ac95242017-09-18 21:28:55 +00001// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11
2
3// Test reproduces a pair of crashes that were caused by code attempting
4// to materialize a default constructor's exception specifier.
5
6template <class T> struct A {
7 static T tab[];
8
9 const int M = UNDEFINED; // expected-error {{use of undeclared identifier}}
10
11 int main()
12 {
13 A<char> a;
14
15 return 0;
16 }
17};
18
19template <class T> struct B {
20 static T tab[];
21
22 // expected-error@+1 {{invalid application of 'sizeof' to an incomplete type}}
23 const int N = sizeof(B<char>::tab) / sizeof(char);
24
25 int main()
26 {
27 B<char> b;
28
29 return 0;
30 }
31};
Richard Smithf3b4ca82018-02-07 22:25:16 +000032
33// This test checks for a crash that resulted from us miscomputing the
34// dependence of a nested initializer list.
35template<int> struct X {
36 static constexpr int n = 4;
37 static constexpr int a[1][1] = {n};
38};
39