Issue 56014
Summary [clang] void is apparently referenceable
Labels clang, clang:diagnostics, invalid-code-generation
Assignees
Reporter cjdb
    The following shouldn't be well-formed, but it is in Clang.
```cpp
template<class T>
using with_reference = T&;

template<class T>
concept can_reference = requires {
  typename with_reference<T>;
};

template<class T>
concept dereferenceable = requires(T& t) {
  { *t } -> can_reference;
};

static_assert(dereferenceable<void*>);
```

**Clang invocation:** `clang++ -std=c++20 -pedantic -pedantic-errors file.cpp`

**Version:**
```
clang version 15.0.0 (https://github.com/llvm/llvm-project.git 186a13f647acac623898bcffa4b966624d2358ba)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-trunk/bin
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to