diff --git a/clang/include/clang/AST/DependenceFlags.h b/clang/include/clang/AST/DependenceFlags.h --- a/clang/include/clang/AST/DependenceFlags.h +++ b/clang/include/clang/AST/DependenceFlags.h @@ -118,10 +118,10 @@ Dependence(TypeDependence D) : V(translate(D, TypeDependence::UnexpandedPack, UnexpandedPack) | - translate(D, TypeDependence::Instantiation, Instantiation) | - translate(D, TypeDependence::Dependent, Dependent) | - translate(D, TypeDependence::VariablyModified, VariablyModified)) { - } + translate(D, TypeDependence::Instantiation, Instantiation) | + translate(D, TypeDependence::Dependent, Dependent) | + translate(D, TypeDependence::Error, Error) | + translate(D, TypeDependence::VariablyModified, VariablyModified)) {} Dependence(ExprDependence D) : V(translate(D, ExprDependence::UnexpandedPack, UnexpandedPack) | diff --git a/clang/test/SemaCXX/invalid-template-base-specifier.cpp b/clang/test/SemaCXX/invalid-template-base-specifier.cpp --- a/clang/test/SemaCXX/invalid-template-base-specifier.cpp +++ b/clang/test/SemaCXX/invalid-template-base-specifier.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -frecovery-ast -verify %s -bool Foo(int *); // expected-note {{candidate function not viable}} +bool Foo(int *); // expected-note {{candidate function not viable}} \ + // expected-note {{candidate function not viable}} template struct Crash : decltype(Foo(T())) { // expected-error {{no matching function for call to 'Foo'}} @@ -8,3 +9,12 @@ }; void test() { Crash(); } // expected-note {{in instantiation of template class}} + +template +using Alias = decltype(Foo(T())); // expected-error {{no matching function for call to 'Foo'}} +template +struct Crash2 : decltype(Alias()) { // expected-note {{in instantiation of template type alias 'Alias' requested here}} + Crash2(){}; +}; + +void test2() { Crash2(); } // expected-note {{in instantiation of template class 'Crash2' requested here}}