35 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s2// RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s3 4// RUN: %clang_cc1 -std=c++11 -emit-pch -fpch-instantiate-templates -o %t %s5// RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s6 7// expected-no-diagnostics8 9// Before the patch, this test triggered an assert violation in10// ASTContext::getSubstTemplateTypeParmType.11 12#ifndef HEADER_INCLUDED13#define HEADER_INCLUDED14 15template <typename T>16using Id = T;17 18template <typename X>19struct Class1 {20 template <typename Y, typename = decltype(Y())>21 struct Nested1;22};23 24template <typename A>25struct Class2 {26 template <typename B, typename = Id<decltype(B())>>27 struct Nested2;28};29 30#else31 32Class2<char> test;33 34#endif35