public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "huangqinjin at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/115231] [C++20] [Modules] deduction guides reachability
Date: Sun, 26 May 2024 10:49:34 +0000	[thread overview]
Message-ID: <bug-115231-4-HK3KyF5a8L@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115231-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from huangqinjin at gmail dot com ---
 g++ -fmodules-ts -std=c++20 module.cpp main.cpp
main.cpp: In function 'int main()':
main.cpp:11:15: error: class template argument deduction failed:
   11 |     A b(B{}, 1);
      |               ^
main.cpp:11:15: error: no matching function for call to 'A@Mod(B, int)'
In module Mod, imported at main.cpp:1:
module.cpp:11:9: note: candidate: 'template<class T> A@Mod(T)-> A@Mod<T>'
   11 |         A(T) {}
      |         ^
module.cpp:11:9: note:   template argument deduction/substitution failed:
main.cpp:11:15: note:   candidate expects 1 argument, 2 provided
   11 |     A b(B{}, 1);
      |               ^
In module Mod, imported at main.cpp:1:
module.cpp:9:9: note: candidate: 'template<class T, class U> A@Mod(U, int)->
A@Mod<T>'
    9 |         A(U, int) {}
      |         ^
module.cpp:9:9: note:   template argument deduction/substitution failed:
main.cpp:11:15: note:   couldn't deduce template parameter 'T'
   11 |     A b(B{}, 1);
      |               ^
In module Mod, imported at main.cpp:1:
module.cpp:6:12: note: candidate: 'template<class T> A@Mod(A@Mod<T>)->
A@Mod<T>'
    6 |     struct A
      |            ^
module.cpp:6:12: note:   template argument deduction/substitution failed:
main.cpp:11:15: note:   'B' is not derived from 'A@Mod<T>'
   11 |     A b(B{}, 1);
      |               ^

  parent reply	other threads:[~2024-05-26 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26 10:37 [Bug c++/115231] New: " huangqinjin at gmail dot com
2024-05-26 10:42 ` [Bug c++/115231] " pinskia at gcc dot gnu.org
2024-05-26 10:48 ` huangqinjin at gmail dot com
2024-05-26 10:48 ` huangqinjin at gmail dot com
2024-05-26 10:49 ` huangqinjin at gmail dot com [this message]
2024-05-26 10:59 ` pinskia at gcc dot gnu.org
2024-05-26 14:33 ` huangqinjin at gmail dot com
2024-06-15 14:16 ` 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-115231-4-HK3KyF5a8L@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).