Author: Haojian Wu Date: 2020-06-24T10:29:30+02:00 New Revision: bfec030e69afc73b29aa1b66902ae802a448fc19
URL: https://github.com/llvm/llvm-project/commit/bfec030e69afc73b29aa1b66902ae802a448fc19 DIFF: https://github.com/llvm/llvm-project/commit/bfec030e69afc73b29aa1b66902ae802a448fc19.diff LOG: [AST][RecoveryExpr] Populate error-bit from Type to Expr. Summary: Looks like this is a fallout when we introduce the error-bit in Type. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D82099 Added: Modified: clang/include/clang/AST/DependenceFlags.h clang/test/SemaCXX/invalid-template-base-specifier.cpp Removed: ################################################################################ diff --git a/clang/include/clang/AST/DependenceFlags.h b/clang/include/clang/AST/DependenceFlags.h index 0b24bae6df9b..54e12ea47fd5 100644 --- a/clang/include/clang/AST/DependenceFlags.h +++ b/clang/include/clang/AST/DependenceFlags.h @@ -118,10 +118,10 @@ class Dependence { 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 index a788cdb859eb..c0f5aabae831 100644 --- 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 <typename T> struct Crash : decltype(Foo(T())) { // expected-error {{no matching function for call to 'Foo'}} @@ -8,3 +9,12 @@ struct Crash : decltype(Foo(T())) { // expected-error {{no matching function for }; void test() { Crash<int>(); } // expected-note {{in instantiation of template class}} + +template <typename T> +using Alias = decltype(Foo(T())); // expected-error {{no matching function for call to 'Foo'}} +template <typename T> +struct Crash2 : decltype(Alias<T>()) { // expected-note {{in instantiation of template type alias 'Alias' requested here}} + Crash2(){}; +}; + +void test2() { Crash2<int>(); } // expected-note {{in instantiation of template class 'Crash2<int>' requested here}} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits