Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[temp.explicit] p4 has a vague expound #4814

Open
xmh0511 opened this issue Aug 15, 2021 · 0 comments
Open

[temp.explicit] p4 has a vague expound #4814

xmh0511 opened this issue Aug 15, 2021 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Aug 15, 2021

[temp.explicit] p4

If the explicit instantiation is for a class or member class, the elaborated-type-specifier in the declaration shall include a simple-template-id; otherwise, the declaration shall be a simple-declaration whose init-declarator-list comprises a single init-declarator that does not have an initializer.

The intent is, in the explicit instantiation for a class or member class, the declaration of the explicit instantiation shall only be an elaborated-type-specifier. But, that expound does not reflect that meaning.

template<class T>
struct A{
    template<class Y>
    struct B{};
};
template 
template<> struct A<int>::B<int>; // error, the declaration is a explicit-specialization

Is the first sentence should be that

If the explicit instantiation is for a class or member class, the declaration shall be a simple-declaration that omits the init-declarator-list where the defining-type-specifier shall be an elaborated-type-specifier that includes a simple-template-id;

As the manner as the second sentence(emphasized part), which will restrict that the declaration couldn't be anything other than a special elaborated-type-specifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant