diff options
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3ccea9e6a45..f91f311a117 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4091,8 +4091,14 @@ cxx_init_decl_processing (void) pop_namespace (); flag_noexcept_type = (cxx_dialect >= cxx17); + /* There's no fixed location for <command-line>, the current + location is <builtins>, which is somewhat confusing. */ if (!flag_new_for_scope) - warning (OPT_Wdeprecated, "%<-fno-for-scope%> is deprecated"); + warning_at (UNKNOWN_LOCATION, OPT_Wdeprecated, + "%<-fno-for-scope%> is deprecated"); + if (flag_friend_injection) + warning_at (UNKNOWN_LOCATION, OPT_Wdeprecated, + "%<-ffriend-injection%> is deprecated"); c_common_nodes_and_builtins (); @@ -9834,7 +9840,14 @@ check_special_function_return_type (special_function_kind sfk, error_at (smallest_type_quals_location (type_quals, locations), "qualifiers are not allowed on declaration of " "deduction guide"); - type = make_template_placeholder (CLASSTYPE_TI_TEMPLATE (optype)); + if (TREE_CODE (optype) == TEMPLATE_TEMPLATE_PARM) + { + error ("template template parameter %qT in declaration of " + "deduction guide", optype); + type = error_mark_node; + } + else + type = make_template_placeholder (CLASSTYPE_TI_TEMPLATE (optype)); for (int i = 0; i < ds_last; ++i) if (i != ds_explicit && locations[i]) error_at (locations[i], @@ -12128,7 +12141,7 @@ grokdeclarator (const cp_declarator *declarator, { error ("%qE is neither function nor member function; " "cannot be declared friend", unqualified_id); - friendp = 0; + return error_mark_node; } decl = NULL_TREE; } |