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

[clang][c++20] Differing behaviour vs msvc and gcc when mixing CRTP and concepts #63401

Open
octurion opened this issue Jun 20, 2023 · 3 comments
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts

Comments

@octurion
Copy link

I was implementing an idea from the following blog post and the followup discussion on Reddit so as to enforce that any CRTP derived class would implement the interfaces the CRTP base class relies on.

The code is as follows: testcase.txt

However, clang seems to reject this specific piece of code (https://godbolt.org/z/9KGhTPncW).

What is more surprising is that it appears that both:

Accept this piece of code.

This means that at least one compiler is incorrect or (highly unlikely, but you never know) the C++ standard is ambiguous in that specific case.

@EugeneZelenko EugeneZelenko added c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts and removed new issue labels Jun 20, 2023
@llvmbot
Copy link
Member

llvmbot commented Jun 20, 2023

@llvm/issue-subscribers-c-20

@llvmbot
Copy link
Member

llvmbot commented Jun 20, 2023

@llvm/issue-subscribers-clang-frontend

@usx95
Copy link
Contributor

usx95 commented Jun 20, 2023

This looks related to conditionally trivial special member functions and deferred concept instantiation.
Notice that clang accepts if the requires clause is on member function crtp_method (https://godbolt.org/z/seGE499ds)
CC: @erichkeane @royjacobson
Looks like a known issue: #44178 (comment)

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
Projects
Status: No status
Development

No branches or pull requests

4 participants