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.expl.spec] p6 not only applies to definitions #4815

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

[temp.expl.spec] p6 not only applies to definitions #4815

xmh0511 opened this issue Aug 15, 2021 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Aug 15, 2021

[temp.expl.spec] p6

Members of an explicitly specialized class template are defined in the same manner as members of normal classes, and not using the template<> syntax. The same is true when defining a member of an explicitly specialized member class. However, template<> is used in defining a member of an explicitly specialized member class template that is specialized as a class template.

The rule seems not only applied to define that member but also includes explicit-specialization.

template<class T>
struct A{
    template<class Y>
    struct B{};
};

template<>
struct A<int>{
    template<class Y>
    struct B;
};

template<>
struct A<int>::B<int>{};

[class.mem.general] p6

A redeclaration of a class member outside its class definition shall be a definition, an explicit specialization, or an explicit instantiation ([temp.expl.spec], [temp.explicit]). The member shall not be a non-static data member.

Could we change the wording "define" to "redeclare" to include these cases?

@xmh0511 xmh0511 changed the title [temp.expl.spec] p6 not only applies to definition [temp.expl.spec] p6 not only applies to definitions Aug 15, 2021
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