[Bug c++/98249] [9 Regression] Improper ADL on the `arg` in `new (arg) T`

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 13 17:41:44 GMT 2022


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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:86d50501e487597d8b97f40d1c87dfcd694a9441

commit r9-10172-g86d50501e487597d8b97f40d1c87dfcd694a9441
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Apr 11 13:06:05 2022 -0400

    c++: operator new lookup [PR98249]

    The standard says, as we quote in the comment just above, that if we don't
    find operator new in the allocated type, it should be looked up in the
    global scope.  This is specifically ::, not just any namespace, and we
    already give an error for an operator new declared in any other namespace.

            PR c++/98249

    gcc/cp/ChangeLog:

            * call.c (build_operator_new_call): Just look in ::.

    gcc/testsuite/ChangeLog:

            * g++.dg/lookup/new3.C: New test.


More information about the Gcc-bugs mailing list