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

Out-of-class definition of member of constrained specialization #58124

Closed
jwakely opened this issue Oct 3, 2022 · 5 comments
Closed

Out-of-class definition of member of constrained specialization #58124

jwakely opened this issue Oct 3, 2022 · 5 comments
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts duplicate Resolved as duplicate

Comments

@jwakely
Copy link
Contributor

jwakely commented Oct 3, 2022

template<class T> concept C1 = true;
template<class T> concept C2 = C1<T> && true;

template<C1> struct X { };
template<C2 T> struct X<T> { struct Y; };

template<C2 T> struct X<T>::Y { }; // (1)

Clang rejects (1) saying:

<source>:7:10: error: type constraint differs in template redeclaration
template<C2 T> struct X<T>::Y { };
         ^
<source>:4:10: note: previous template declaration is here
template<C1 T> struct X { };
         ^
<source>:7:29: error: no struct named 'Y' in 'X<T>'
template<C2 T> struct X<T>::Y { };
                      ~~~~~~^

This is wrong, Y is a member of the partial specialization on line 5, not the primary template on line 4.

@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed new issue labels Oct 3, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 3, 2022

@llvm/issue-subscribers-clang-frontend

@royjacobson
Copy link
Contributor

Looks like duplicate of #50208.

@royjacobson royjacobson added the concepts C++20 concepts label Oct 3, 2022
@usx95 usx95 added the c++20 label Oct 30, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 30, 2022

@llvm/issue-subscribers-c-20

@jwakely
Copy link
Contributor Author

jwakely commented Nov 1, 2022

#50208 is now closed as a dup of #49620

@usx95
Copy link
Contributor

usx95 commented Jan 11, 2023

Duplicate of #49620

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" concepts C++20 concepts duplicate Resolved as duplicate
Projects
Status: Done
Development

No branches or pull requests

5 participants