https://bugs.llvm.org/show_bug.cgi?id=45219
Bug ID: 45219
Summary: non-bool expression allowed in requires clause
Product: clang
Version: 10.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++2a
Assignee: unassignedclangb...@nondot.org
Reporter: akrze...@gmail.com
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk
Clang trunk compiles the following invalid C++20 code.
```
#include <string>
#include <iostream>
template <typename T>
requires T::operator int
std::string fun(T) { std::cout << 1; }
template <typename T>
void fun(T) { std::cout << 0; }
int main()
{
fun(1); // expected hard compiler error
}
```
It should not compile because expression `T::operator int` does not have type
bool.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs