public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110191] New: Alias template in function parameter does not match the nested type it refers to
@ 2023-06-09  9:22 fchelnokov at gmail dot com
  2023-06-09 12:36 ` [Bug c++/110191] " ppalka at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: fchelnokov at gmail dot com @ 2023-06-09  9:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110191
           Summary: Alias template in function parameter does not match
                    the nested type it refers to
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

This program

template<typename T>
struct A {
    struct Inner {};
    void foo(Inner in);
};

template<typename T>
using AInner = typename A<T>::Inner;

template<typename T>
void A<T>::foo(AInner<T>) {}

is valid and accepted in Clang and MSVC, but GCC complains:

error: no declaration matches 'void A<T>::foo(AInner<T>)'
   11 | void A<T>::foo(AInner<T>) {}
      |      ^~~~
<source>:4:10: note: candidate is: 'void A<T>::foo(Inner)'
    4 |     void foo(Inner in);
      |          ^~~
<source>:2:8: note: 'struct A<T>' defined here
    2 | struct A {

Online demo: https://gcc.godbolt.org/z/5Pv9KW8vj

Related discussion: https://stackoverflow.com/q/76416600/7325599

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

* [Bug c++/110191] Alias template in function parameter does not match the nested type it refers to
  2023-06-09  9:22 [Bug c++/110191] New: Alias template in function parameter does not match the nested type it refers to fchelnokov at gmail dot com
@ 2023-06-09 12:36 ` ppalka at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-06-09 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
dup

*** This bug has been marked as a duplicate of bug 101789 ***

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

end of thread, other threads:[~2023-06-09 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09  9:22 [Bug c++/110191] New: Alias template in function parameter does not match the nested type it refers to fchelnokov at gmail dot com
2023-06-09 12:36 ` [Bug c++/110191] " ppalka 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).