public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppalka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/114795] internal compiler error: in finish_member_declaration after module import in gcc 14.0.1 snapshot
Date: Tue, 23 Apr 2024 16:14:51 +0000	[thread overview]
Message-ID: <bug-114795-4-0nAy9vjQMr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114795-4@http.gcc.gnu.org/bugzilla/>

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-04-23
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Reduced version of comment #6 testcase:

$ cat 114795_a.H
template<class T>
struct A {
  auto f() { return 0; }
};

template<class T>
inline void g() {
  A<int> a;
  a.f();
}

$ cat 114795_b.C
template<class T>
struct A {
  auto f() { return 0; }
};

A<int> a;

import "114795_a.H";

int main() {
  g<int>();
}

$ g++ -fmodules-ts 114795_*
In module ./114795-2_a.H, imported at 114795_b.C:8:
114795_a.H: In instantiation of ‘void g() [with T = int]’:
114795_b.C:11:9:   required from here
   11 |   g<int>();
      |   ~~~~~~^~
114795_a.H:9:6: error: use of ‘auto A<T>::f() [with T = int]’ before deduction
of ‘auto’
    9 |   a.f();
      |   ~~~^~
114795_a.H:9:6: error: use of ‘auto A<T>::f() [with T = int]’ before deduction
of ‘auto’


I think I have a fix -- we need to propagate an already-deduced return type
during deduplication.

  parent reply	other threads:[~2024-04-23 16:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-21 14:38 [Bug c++/114795] New: " porten at kde dot org
2024-04-21 22:17 ` [Bug c++/114795] " porten at kde dot org
2024-04-22  0:20 ` porten at kde dot org
2024-04-22  1:52 ` nshead at gcc dot gnu.org
2024-04-22  7:37 ` porten at kde dot org
2024-04-22  8:51 ` nshead at gcc dot gnu.org
2024-04-22 22:49 ` porten at kde dot org
2024-04-23 16:14 ` ppalka at gcc dot gnu.org [this message]
2024-04-23 18:01 ` cvs-commit at gcc dot gnu.org
2024-04-23 18:09 ` ppalka at gcc dot gnu.org
2024-04-24  7:15 ` porten at kde dot 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-114795-4-0nAy9vjQMr@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).