forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
https://godbolt.org/z/bq3cj6Yxd
template<class T> struct Holder { T t; };
struct Incomplete;
static_assert(!__is_trivially_equality_comparable(Holder<Holder<Incomplete>*>));
Clang 17 and 18 accept this snippet. Clang trunk (the rising Clang 19) does not accept it:
<source>:1:37: error: field has incomplete type 'Incomplete'
1 | template<class T> struct Holder { T t; };
| ^
<source>:3:16: note: in instantiation of template class 'Holder<Incomplete>' requested here
3 | static_assert(!__is_trivially_equality_comparable(Holder<Holder<Incomplete>*>));
| ^
<source>:2:8: note: forward declaration of 'Incomplete'
2 | struct Incomplete;
| ^
This is caused by c6e996a (llvm#93113, llvm#97894). Maybe it's an unavoidable side effect of the new approach; but it's kind of inconvenient because it means __is_trivially_equality_comparable
can't be used as a generic building block in many situations (because it can trigger a hard error instead of just returning false). It would certainly be nice if Clang 19 would behave the same way as Clang 18 for this three-line snippet. (attn @philnik777)
Metadata
Metadata
Assignees
Labels
No labels