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