public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nshead at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101140] [modules] no matching function for call to ‘operator new(sizetype, void*)’
Date: Tue, 26 Mar 2024 13:54:53 +0000	[thread overview]
Message-ID: <bug-101140-4-mia5sJU8Jd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101140-4@http.gcc.gnu.org/bugzilla/>

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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |nshead at gcc dot gnu.org
   Last reconfirmed|                            |2024-03-26

--- Comment #3 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
I believe this should be valid. The declaration of `::operator new` should be
reachable within the instantiation context of 'construct_at' , and thus
shouldn't need to be exported to be called. (See [module.context] and
[module.reach].)

The issue looks to be that `tsubst_expr` when handling a NEW_EXPR just calls
`build_new`, which ultimately does `build_operator_new_call` that uses normal
`lookup_qualified_name (global_namespace, fnname)` that doesn't consider
non-exported entities. We need some way to signify that lookup should also
consider declarations reachable from other points in the template's
instantiation context.

This could be related to one of the issues causing PR114275, but in that cases
it's failing to find instantiations of friend classes in the instantiation
context.

  parent reply	other threads:[~2024-03-26 13:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-20 14:52 [Bug c++/101140] New: " ensadc at mailnesia dot com
2021-09-06 11:05 ` [Bug c++/101140] " ensadc at mailnesia dot com
2022-02-11 12:31 ` asynts+bugs at gmail dot com
2024-03-26 13:54 ` nshead at gcc dot gnu.org [this message]
2024-03-26 14:50 ` ppalka at gcc dot gnu.org
2024-03-26 23:54 ` nshead at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101140-4-mia5sJU8Jd@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).