[PATCH] D126907: Deferred Concept Instantiation Implementation Take 2

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 11 07:47:31 PDT 2022


erichkeane added a comment.

In D126907#3846591 <https://reviews.llvm.org/D126907#3846591>, @erichkeane wrote:

> In D126907#3844788 <https://reviews.llvm.org/D126907#3844788>, @BertalanD wrote:
>
>> Hi @erichkeane,
>>
>> This change broke compilation of this program (https://godbolt.org/z/KrWGvcf8h; reduced from https://github.com/SerenityOS/ladybird):
>>
>>   template<typename T, typename U>
>>   constexpr bool IsSame = false;
>>   
>>   template<typename T>
>>   constexpr bool IsSame<T, T> = true;
>>   
>>   template<typename T>
>>   struct Foo {
>>       template<typename U>
>>       Foo(U&&) requires (!IsSame<U, Foo>);
>>   };
>>   
>>   template<>
>>   struct Foo<void> : Foo<int> {
>>       using Foo<int>::Foo;
>>   };
>>   
>>   Foo<void> test() { return 0; }
>>
>>
>>
>>   <source>:18:27: error: invalid reference to function 'Foo': constraints not satisfied
>>   Foo<void> test() { return 0; }
>>                             ^
>>   <source>:10:24: note: because substituted constraint expression is ill-formed: value of type '<dependent type>' is not contextually convertible to 'bool'
>>       Foo(U&&) requires (!IsSame<U, Foo>);
>>                          ^
>
> Thanks for the report!  I'll look into it ASAP.

Quick note: I believe I understand the cause of this, which requires a bit more work than I otherwise would have expected.  I have a candidate patch I'm running through my testing right now that should fix this, but it still needs cleaning up.  Expect it in the next day or two if all goes well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126907/new/

https://reviews.llvm.org/D126907



More information about the cfe-commits mailing list