10ac9524cSErich Keane // RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11
20ac9524cSErich Keane 
30ac9524cSErich Keane // Test reproduces a pair of crashes that were caused by code attempting
40ac9524cSErich Keane // to materialize a default constructor's exception specifier.
50ac9524cSErich Keane 
60ac9524cSErich Keane template <class T> struct A {
70ac9524cSErich Keane   static T tab[];
80ac9524cSErich Keane 
90ac9524cSErich Keane   const int M = UNDEFINED; // expected-error {{use of undeclared identifier}}
100ac9524cSErich Keane 
mainA110ac9524cSErich Keane   int main()
120ac9524cSErich Keane   {
130ac9524cSErich Keane     A<char> a;
140ac9524cSErich Keane 
150ac9524cSErich Keane     return 0;
160ac9524cSErich Keane   }
170ac9524cSErich Keane };
180ac9524cSErich Keane 
190ac9524cSErich Keane template <class T> struct B {
200ac9524cSErich Keane   static T tab[];
210ac9524cSErich Keane 
220ac9524cSErich Keane   // expected-error@+1 {{invalid application of 'sizeof' to an incomplete type}}
230ac9524cSErich Keane   const int N = sizeof(B<char>::tab) / sizeof(char);
240ac9524cSErich Keane 
mainB250ac9524cSErich Keane   int main()
260ac9524cSErich Keane   {
270ac9524cSErich Keane     B<char> b;
280ac9524cSErich Keane 
290ac9524cSErich Keane     return 0;
300ac9524cSErich Keane   }
310ac9524cSErich Keane };
32*f3b4ca89SRichard Smith 
33*f3b4ca89SRichard Smith // This test checks for a crash that resulted from us miscomputing the
34*f3b4ca89SRichard Smith // dependence of a nested initializer list.
35*f3b4ca89SRichard Smith template<int> struct X {
36*f3b4ca89SRichard Smith   static constexpr int n = 4;
37*f3b4ca89SRichard Smith   static constexpr int a[1][1] = {n};
38*f3b4ca89SRichard Smith };
39*f3b4ca89SRichard Smith 
40