public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability
@ 2024-05-26 10:37 huangqinjin at gmail dot com
  2024-05-26 10:42 ` [Bug c++/115231] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: huangqinjin at gmail dot com @ 2024-05-26 10:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115231
           Summary: [C++20] [Modules] deduction guides reachability
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: huangqinjin at gmail dot com
  Target Milestone: ---

Refer to https://eel.is/c++draft/temp.deduct.guide#nt:deduction-guide,

> Deduction guides are not found by name lookup.
> Instead, when performing class template argument deduction,
> all reachable deduction guides declared for the class template are considered.

GCC cannot find the deduction guides that are not exported, while both Clang
and MSVC can.

https://godbolt.org/z/9rW3TTMMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/115231] [C++20] [Modules] deduction guides reachability
  2024-05-26 10:37 [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability huangqinjin at gmail dot com
@ 2024-05-26 10:42 ` pinskia at gcc dot gnu.org
  2024-05-26 10:48 ` huangqinjin at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-26 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2024-05-26
             Blocks|103524                      |
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you attach a testcase instead of linking to godbolt. Also try one that does
not use cmake. Please read https://gcc.gnu.org/bugs since that points out what
is needed here.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524
[Bug 103524] [meta-bug] modules issue

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/115231] [C++20] [Modules] deduction guides reachability
  2024-05-26 10:37 [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability 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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: huangqinjin at gmail dot com @ 2024-05-26 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from huangqinjin at gmail dot com ---
Created attachment 58290
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58290&action=edit
module.cpp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/115231] [C++20] [Modules] deduction guides reachability
  2024-05-26 10:37 [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability 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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: huangqinjin at gmail dot com @ 2024-05-26 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from huangqinjin at gmail dot com ---
Created attachment 58291
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58291&action=edit
main.cpp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/115231] [C++20] [Modules] deduction guides reachability
  2024-05-26 10:37 [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability huangqinjin at gmail dot com
                   ` (2 preceding siblings ...)
  2024-05-26 10:48 ` huangqinjin at gmail dot com
@ 2024-05-26 10:49 ` huangqinjin at gmail dot com
  2024-05-26 10:59 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: huangqinjin at gmail dot com @ 2024-05-26 10:49 UTC (permalink / raw)
  To: gcc-bugs

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);
      |               ^

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/115231] [C++20] [Modules] deduction guides reachability
  2024-05-26 10:37 [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability huangqinjin at gmail dot com
                   ` (3 preceding siblings ...)
  2024-05-26 10:49 ` huangqinjin at gmail dot com
@ 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
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-26 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |UNCONFIRMED
     Ever confirmed|1                           |0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/115231] [C++20] [Modules] deduction guides reachability
  2024-05-26 10:37 [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability huangqinjin at gmail dot com
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: huangqinjin at gmail dot com @ 2024-05-26 14:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from huangqinjin at gmail dot com ---
It is currently impossible to use `export using` style like libc++ to implement
`import std`, for example
https://en.cppreference.com/w/cpp/utility/expected/unexpected.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/115231] [C++20] [Modules] deduction guides reachability
  2024-05-26 10:37 [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability huangqinjin at gmail dot com
                   ` (5 preceding siblings ...)
  2024-05-26 14:33 ` huangqinjin at gmail dot com
@ 2024-06-15 14:16 ` nshead at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-06-15 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
                 CC|                            |nshead at gcc dot gnu.org
   Last reconfirmed|2024-05-26 00:00:00         |2024-06-15
           Assignee|unassigned at gcc dot gnu.org      |nshead at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-15 14:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-26 10:37 [Bug c++/115231] New: [C++20] [Modules] deduction guides reachability 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
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

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).