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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org,
                   |                            |redi at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think this boils down when should calls to immediate functions be evaluated
in default arguments.
What GCC implements right now is that calls to consteval functions in default
arguments are deferred until later if the default argument is for an immediate
function (and is then evaluated later when call to such consteval function is
seen outside of immediate context), but otherwise is evaluated immediately
while parsing the default argument.
In the testcase, as s::s(source_location) or void f(source_location) aren't
immediate, the constexpr evaluation is performed on the default argument right
away.
Now, if that is not how it should be treated, please point me at where the C++
standard says so.

Reply via email to