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

Missing case from "down with typename" #63119

Closed
ilya-biryukov opened this issue Jun 5, 2023 · 3 comments
Closed

Missing case from "down with typename" #63119

ilya-biryukov opened this issue Jun 5, 2023 · 3 comments
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@ilya-biryukov
Copy link
Contributor

Found by looking at g++.dg/cpp2a/typename16.C from the GCC test suite.
Clang produces an error here:

struct X { X(int); };
template<typename T> struct S {
  friend X::X(T::type);
  // <source>:3:13: error: qualified reference to 'X' is a constructor name rather than a type in this context
};

GCC and MSVC accept the code with no errors. See godbolt.

I believe Clang should accept this code without typename according to (temp.res)p4.3:

4. A qualified or unqualified name is said to be in a type-only context if it is the terminal name of
...
4.3 a decl-specifier of the decl-specifier-seq of a 
...
4.3.3 parameter-declaration in a member-declaration,125 unless that parameter-declaration appears in a default argument,
@ilya-biryukov ilya-biryukov added c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jun 5, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 5, 2023

@llvm/issue-subscribers-clang-frontend

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 5, 2023

@llvm/issue-subscribers-c-20

@cor3ntin
Copy link
Contributor

cor3ntin commented Jun 6, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
Status: No status
Development

No branches or pull requests

3 participants