Issue 161983
Summary [clang] Variadic concept defined in terms of another concept improperly cached
Labels clang
Assignees
Reporter davidstone
    The following valid translation unit

```c++
template<bool b>
concept bool_ = b;

template<typename... Ts>
concept unary = bool_<sizeof...(Ts) == 1>;

static_assert(!unary<>);
static_assert(unary<void>);
```
causes clang to fail with

```console
<source>:8:15: error: static assertion failed
    8 | static_assert(unary<void>);
      | ^~~~~~~~~~~
<source>:8:15: note: because 'void' does not satisfy 'unary'
<source>:5:17: note: because 'sizeof...(Ts) == 1' does not satisfy 'bool_'
    5 | concept unary = bool_<sizeof...(Ts) == 1>;
      | ^
<source>:2:17: note: because 'false' evaluated to false
    2 | concept bool_ = b;
      |                 ^
1 error generated.
Compiler returned: 1
```

Commenting out either static assert causes the failure to go away. This was introduced by 9583b399d85cacdfa0a41f798ab44abaa3981bbf @cor3ntin @zyn0217 

See it live: https://godbolt.org/z/r5nPr5TKe
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to