https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124457

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #4)
> Part of the issue with AlsoTrue is that we still represent the
> return-type-requirement as a constrained auto, as a legacy of the Concepts
> TS implementation, but that's mostly a distraction...
> 
> ...because the f3 case is in fact a placeholder, and I still think it should
> be accepted; we shouldn't reject a type-constraint based on where it's used.
> We'll eventually take the reflection of the deduced type.
> 
> make_constrained_placeholder_type could do something to obscure the
> placeholderness across the call to build_concept_check?

Perhaps just change its name?

--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -30941,7 +30941,10 @@ make_constrained_placeholder_type (tree type, tree
con, tree args)
   /* Build the constraint. */
   tree tmpl = DECL_TI_TEMPLATE (con);
   ++processing_template_decl;
+  tree old_name = TYPE_IDENTIFIER (type);
+  TYPE_IDENTIFIER (type) = make_generic_type_name ();
   tree expr = build_concept_check (tmpl, type, args, tf_warning_or_error);
+  TYPE_IDENTIFIER (type) = old_name;
   --processing_template_decl;

   PLACEHOLDER_TYPE_CONSTRAINTS_INFO (type)

Reply via email to