Repository navigation
Out-of-class member template definition rejected when a non-type template parameter type uses a member typedef #505
Saldivarcher
started this conversation in
Issue Triage - Compilation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Issue Summary
An out-of-class definition of a member template is rejected as incompatible
with its declaration when a non-type template parameter has a member typedef
of the enclosing class template as its type. In the class, the type is written
as
V. Outside the class, the type must be written astypename S<T>::V.These name the same type, so the two template parameter lists are equivalent
([temp.over.link]).
GCC 15, Clang 21 and MSVC v19.latest accept the program. EDG 6.5 and trunk
reject it in default mode. EDG also rejects it with
--microsoft. EDG acceptsit with
--gnu_versionand--clang_version.Reproducing Source Code
https://godbolt.org/z/63eG8h1fb
Command-line Options
cpfe --c++17 --no_wrap_diagnostics --no_code_gen nttp.cc
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
Output:
Variants
T Ntypename S<T>::V *instead of a template parameterint (*)(V *)vsint (*)(typename S<T>::V *)template <V N> struct M;defined astemplate <typename S<T>::V N> struct S<T>::M {};The member class template gives this error:
Reproducing (Standard) Configuration(s)
linux-gcc-debug
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
LICENSE.txtfile in my.zipor.tar.gzupload. If I included aLICENSE.txtfile, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.All reactions