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

[dcl.typedef] p2 Unexplained lookup "error" in example #5107

Closed
jensmaurer opened this issue Nov 13, 2021 · 2 comments · Fixed by #5108
Closed

[dcl.typedef] p2 Unexplained lookup "error" in example #5107

jensmaurer opened this issue Nov 13, 2021 · 2 comments · Fixed by #5108
Assignees

Comments

@jensmaurer
Copy link
Member

jensmaurer commented Nov 13, 2021

using cell = pair<void*, cell*>;    // error

Two issues: pair is undefined here (is it std::pair?) and the error is unexplained.
The explanation for the error is in [basic.scope.pdecl] p4:

The locus of a using-declarator that does not name a constructor is immediately after the using-declarator (9.9).

Source: Vladimir Grigoriev on std-discussion 2021-11-13

@xmh0511
Copy link
Contributor

xmh0511 commented Nov 15, 2021

It seems there is nothing related to using-declarator since the declaration is not a using-declaration; it's just an alias-declaration. Presumably, the explanation is in [basic.scope.pdecl] p3

The locus of an alias-declaration is immediately after it.

So, the name cannot be found until the end of the alias-declaration.

@jensmaurer
Copy link
Member Author

jensmaurer commented Nov 15, 2021

Oh, right, I was confused.

@jensmaurer jensmaurer self-assigned this Nov 20, 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

Successfully merging a pull request may close this issue.

2 participants