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
A definition for a class introduces a class scope rather than doing that by a declaration that is not a definition #4776
Comments
@jensmaurer Could you please take a look at this issue? |
I'm not sure there is a real bug here. What exactly goes wrong if |
If it were, I think the argument enforces this #4775 issue. Consider this example template < class D >
struct B {
D::type x;
};
struct A { using type = int; };
struct C; //#1 if it introduced a class scope of C
struct C : A, B< C >{
}; That means from the point "P" at
Is the base class In addition, Is that "if any" maybe just a nod toward that the class-specifier with an empty "member-specification"? I cannot figure out a normative rule that can interpret the above example except that we consider that a class scope is only introduced after the closing "{" of a class-specifier and a declaration(not a definition) of a class does not introduce the scope. |
[basic.scope.class#1]
The declaration of a class or class template does not definitely specify that the declaration must be the definition, which could be inferred from [dcl.dcl#dcl.pre-5]
That hints
struct C;
is also a declaration of classC
, however, the declaration does not introduce a class scope. I think we should reduce the extent of "declaration" to use "definition", which means only aclass-specifier
can introduce the class scope.The text was updated successfully, but these errors were encountered: