-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issueDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issuewaiting-for-wg21Blocked on C++ Standards CommitteeBlocked on C++ Standards Committee
Description
Bugzilla Link | 49133 |
Version | 11.0 |
OS | Linux |
CC | @dwblaikie,@DougGregor,@zygoloid |
Extended Description
Clang does not accept explicit class template instantiation of a nested type.
Minimal example:
template <typename>
struct Tp {
using Alias = Tp;
};
/// All should be valid and equivalent
extern template struct Tp<int>; //< works
extern template struct Tp<int>::Tp; //< fails
extern template struct Tp<int>::Alias::Tp; //< fails
error: explicit instantiation of non-templated type 'Tp<int>'
The inst. of nested types should be standard-compliant as well as the first one.
Also, the error message is quite confusing.
Works in GCC.
https://stackoverflow.com/questions/34506356/using-typedef-in-template-instantiation-and-extern-template-declaration/34506955#34506955
https://stackoverflow.com/questions/11414817/code-duplication-between-typedefs-and-explicit-instantiations
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issueDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issuewaiting-for-wg21Blocked on C++ Standards CommitteeBlocked on C++ Standards Committee