diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2929,8 +2929,8 @@ // Recovery AST still heavily relies on dependent-type machinery. Opts.RecoveryAST = Args.hasFlag(OPT_frecovery_ast, OPT_fno_recovery_ast, Opts.CPlusPlus); - Opts.RecoveryASTType = - Args.hasFlag(OPT_frecovery_ast_type, OPT_fno_recovery_ast_type, false); + Opts.RecoveryASTType = Args.hasFlag( + OPT_frecovery_ast_type, OPT_fno_recovery_ast_type, Opts.CPlusPlus); Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions); Opts.AccessControl = !Args.hasArg(OPT_fno_access_control); Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors); diff --git a/clang/test/CXX/temp/temp.constr/temp.constr.order/function-templates.cpp b/clang/test/CXX/temp/temp.constr/temp.constr.order/function-templates.cpp --- a/clang/test/CXX/temp/temp.constr/temp.constr.order/function-templates.cpp +++ b/clang/test/CXX/temp/temp.constr/temp.constr.order/function-templates.cpp @@ -67,7 +67,8 @@ // expected-note@-1 {{candidate function [with T = long long, U = int]}} static_assert(sizeof(f())); -// expected-error@-1 {{call to 'f' is ambiguous}} +// expected-error@-1 {{call to 'f' is ambiguous}} \ + expected-error@-1 {{invalid application of 'sizeof' to an incomplete type 'void'}} template concept C3 = true; diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/fixed-expansion.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/fixed-expansion.cpp --- a/clang/test/CXX/temp/temp.decls/temp.variadic/fixed-expansion.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.variadic/fixed-expansion.cpp @@ -123,7 +123,10 @@ template struct S {}; template using U = S; // expected-note 2{{template parameter is declared here}} template U &f(U, Ts...); // expected-error 2{{pack expansion used as argument for non-pack parameter of alias template}} - S &s1 = f({}, 0, 0.0); // expected-error {{no matching function}} + // The return type of f is invalid during instantiation, and int is the fallback. + // FIXME: would be nice to suppress the secondard "cannot bind to a value of unrelated type 'int'" diagnostic. + S &s1 = f({}, 0, 0.0); // expected-error {{no matching function}} \ + expected-error {{non-const lvalue reference to type 'S' cannot bind to a value of unrelated type 'int'}} } namespace PR18401 { diff --git a/clang/test/SemaTemplate/dependent-names.cpp b/clang/test/SemaTemplate/dependent-names.cpp --- a/clang/test/SemaTemplate/dependent-names.cpp +++ b/clang/test/SemaTemplate/dependent-names.cpp @@ -173,7 +173,7 @@ namespace O { - void f(char&); // expected-note {{candidate function not viable}} + int f(char&); // expected-note {{candidate function not viable}} template struct C { static const int n = f(T()); // expected-error {{no matching function}}