-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 concepts
Description
Bugzilla Link | 46269 |
Version | trunk |
OS | Linux |
CC | @efriedma-quic,@qookei,@zygoloid,@saarraz |
Extended Description
When there are multiple destructors constrained with a requires clause, only the first one is considered, like in the following code:
template <bool B>
struct A {
~A() requires (B) { }
~A() requires (!B) { }
};
A<false> x;
The compiler reports the following error:
<source>:7:10: error: invalid reference to function '~A': constraints not satisfied
A<false> x;
^
<source>:3:20: note: because 'false' evaluated to false
~A() requires (B) { }
^
The compiler prematurely reports an error about an invalid reference to the destructor because the constraint on the first variant was not satisfied, without checking the second variant.
The same code compiles with GCC without any problems.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 concepts
Type
Projects
Status
No status