aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog23
-rw-r--r--gcc/cp/decl.cc6
-rw-r--r--gcc/cp/parser.cc12
3 files changed, 36 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 23511a0..38a2d68 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,26 @@
+2025-07-07 Alfie Richards <alfie.richards@arm.com>
+
+ PR c++/119498
+ * decl.cc (duplicate_decls): Change logic to not always exclude FMV
+ annotated functions in cases of return type non-ambiguation.
+
+2025-07-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/120917
+ * parser.cc (cp_parser_simple_type_specifier): Attach
+ auto in targ in parameter to -Wabbreviated-auto-in-template-arg.
+ (cp_parser_placeholder_type_specifier): Diagnose constrained auto in
+ template arg.
+
+2025-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/84009
+ * parser.cc (cp_parser_decomposition_declaration): Pedwarn
+ on thread_local, __thread or static in decl_specifiers for
+ for-range-declaration.
+ (cp_parser_init_declarator): Likewise, and also for extern
+ or register.
+
2025-07-04 Jason Merrill <jason@redhat.com>
PR c++/120575
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index 83c8e28..be26bd3 100644
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -2014,8 +2014,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
}
/* For function versions, params and types match, but they
are not ambiguous. */
- else if ((!DECL_FUNCTION_VERSIONED (newdecl)
- && !DECL_FUNCTION_VERSIONED (olddecl))
+ else if (((!DECL_FUNCTION_VERSIONED (newdecl)
+ && !DECL_FUNCTION_VERSIONED (olddecl))
+ || !same_type_p (fndecl_declared_return_type (newdecl),
+ fndecl_declared_return_type (olddecl)))
/* Let constrained hidden friends coexist for now, we'll
check satisfaction later. */
&& !member_like_constrained_friend_p (newdecl)
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 44a7832..239e6f9 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -21021,9 +21021,6 @@ cp_parser_simple_type_specifier (cp_parser* parser,
"only available with "
"%<-std=c++14%> or %<-std=gnu++14%>");
}
- else if (parser->in_template_argument_list_p)
- error_at (token->location,
- "use of %<auto%> in template argument");
else if (!flag_concepts)
pedwarn (token->location, OPT_Wc__20_extensions,
"use of %<auto%> in parameter declaration "
@@ -21033,6 +21030,11 @@ cp_parser_simple_type_specifier (cp_parser* parser,
"use of %<auto%> in parameter declaration "
"only available with "
"%<-std=c++14%> or %<-std=gnu++14%>");
+
+ if (parser->in_template_argument_list_p)
+ permerror_opt (token->location,
+ OPT_Wabbreviated_auto_in_template_arg,
+ "use of %<auto%> in template argument");
}
else
type = make_auto ();
@@ -21479,6 +21481,10 @@ cp_parser_placeholder_type_specifier (cp_parser *parser, location_t loc,
error_at (loc, "cannot declare a parameter with %<decltype(auto)%>");
return error_mark_node;
}
+ if (parser->in_template_argument_list_p)
+ permerror_opt (placeholder->location,
+ OPT_Wabbreviated_auto_in_template_arg,
+ "use of %<auto%> in template argument");
tree parm = build_constrained_parameter (con, proto, args);
return synthesize_implicit_template_parm (parser, parm);
}