1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s 2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s 3*0a6a1f1dSLionel Sambuc 4*0a6a1f1dSLionel Sambuc // expected-no-diagnostics 5*0a6a1f1dSLionel Sambuc 6*0a6a1f1dSLionel Sambuc // Before the patch, this test triggered an assert violation in 7*0a6a1f1dSLionel Sambuc // ASTContext::getSubstTemplateTypeParmType. 8*0a6a1f1dSLionel Sambuc 9*0a6a1f1dSLionel Sambuc #ifndef HEADER_INCLUDED 10*0a6a1f1dSLionel Sambuc #define HEADER_INCLUDED 11*0a6a1f1dSLionel Sambuc 12*0a6a1f1dSLionel Sambuc template <typename T> 13*0a6a1f1dSLionel Sambuc using Id = T; 14*0a6a1f1dSLionel Sambuc 15*0a6a1f1dSLionel Sambuc template <typename X> 16*0a6a1f1dSLionel Sambuc struct Class1 { 17*0a6a1f1dSLionel Sambuc template <typename Y, typename = decltype(Y())> 18*0a6a1f1dSLionel Sambuc struct Nested1; 19*0a6a1f1dSLionel Sambuc }; 20*0a6a1f1dSLionel Sambuc 21*0a6a1f1dSLionel Sambuc template <typename A> 22*0a6a1f1dSLionel Sambuc struct Class2 { 23*0a6a1f1dSLionel Sambuc template <typename B, typename = Id<decltype(B())>> 24*0a6a1f1dSLionel Sambuc struct Nested2; 25*0a6a1f1dSLionel Sambuc }; 26*0a6a1f1dSLionel Sambuc 27*0a6a1f1dSLionel Sambuc #else 28*0a6a1f1dSLionel Sambuc 29*0a6a1f1dSLionel Sambuc Class2<char> test; 30*0a6a1f1dSLionel Sambuc 31*0a6a1f1dSLionel Sambuc #endif 32