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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-08-21
             Blocks|                            |123615
           Keywords|                            |accepts-invalid, c++26
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot 
gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This should probably work:

--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -503,9 +503,9 @@ immediate_escalating_function_p (tree fn)
     specifier  */
   if (LAMBDA_FUNCTION_P (fn))
     return true;
-  /* -- a defaulted function that is not declared with the
+  /* -- a non-user-provided defaulted function that is not declared with the
    consteval specifier  */
-  if (DECL_DEFAULTED_FN (fn))
+  if (DECL_DEFAULTED_FN (fn) && !user_provided_p (fn))
     return true;
   /* -- a function that results from the instantiation of a templated entity
    defined with the constexpr specifier.  */


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123615
[Bug 123615] (c++-reflection) - [meta-bug] reflection issue

Reply via email to