[llvm-bugs] [Bug 48656] New: front end crash when using variadic concepts requirement with "or" statement (trunk/11)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 4 12:26:28 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=48656

            Bug ID: 48656
           Summary: front end crash when using variadic concepts
                    requirement with "or" statement (trunk/11)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ryan_greenblatt at brown.edu
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Created attachment 24341
  --> https://bugs.llvm.org/attachment.cgi?id=24341&action=edit
crashes

This crash occurs on trunk and on 11 with `clang++ -std=c++20 FILENAME`.
I think I have a pretty minimal reproduction.

```
template <unsigned> struct A { static constexpr bool a = true; };

template <typename T>
concept BoolOrRequirement = requires {
  requires requires {
    // any requirement (outside of a few trivial ones)
    T::b;
  } || T::a;
};

template <BoolOrRequirement...>
struct B {};

int main() {
  // need at least 2 elements for crash, more elements seems to increase
  // consistancy of crash
  B<A<0>, A<1>, A<2>, A<3>, A<4>> value;
}
```

Here is a godbolt link: https://godbolt.org/z/vz7Wss.
I have also attached the source file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210104/d56e8853/attachment.html>


More information about the llvm-bugs mailing list