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