MagentaTreehouse
MagentaTreehouse
The following C++20 code causes a crash on clang 17: ```cpp template struct A { template using Func = decltype([] {return U{};}); }; A::Func f{}; int i{f()}; ``` Compiler Explorer:...
The following code, when using MSVC STL, triggers the clang warning enabled by `-Wctad-maybe-unsupported`. ```cpp #include int main() { return std::equal_to{}(-1, 1); } ``` ``` .\test.cpp:12:9: warning: 'equal_to' may not...
The following code fails to compile: ```cpp struct Array { int data[2]; }; Array f() { return {}; } int main() { auto [a, b]{f().data}; // xvalue init using T...
In the following code, the `constexpr` specifier should not be allowed in the explicit instantiation. It is rejected by GCC, but accepted by Clang. ```c++ template inline constexpr int i{};...
Reproducer: ```cpp int main() { void{}; } ``` This expression `void{}` causes an ICE in clang trunk. In clang 19.1, it gets rejected. See compiler Explorer: https://godbolt.org/z/e85YYTaTx
[Clang] Variable template partial specialization cannot specialize primary template with `auto` NTTP
Reproducer: ```c++ template constexpr bool b = false; template constexpr bool b = true; ``` Error: ``` :2:33: error: variable template partial specialization does not specialize any template argument; to...
```c++ template struct A { template static auto foo(F, G g = {}) { g(); } }; int main() { A::foo(0.); } ``` Unreachable: ```console undeduced type in IR-generation UNREACHABLE...
```c++ template void f(T t) { [x = t] (decltype(x)) {}; } ``` Crash since clang 17: ```console Program terminated with signal: SIGSEGV Compiler returned: 139 ``` Compiler Explorer: https://godbolt.org/z/6EWaoa79s...
The location of the attribute is non-standard in this code: ```c++ namespace N [[deprecated]] {} ``` But clang doesn't emit any diagnostics with `-Wall -Wextra -Wpedantic`. Compiler Explorer: https://compiler-explorer.com/z/6zcPanj5Y
```c++ struct A { *A(); }; ``` See Compiler Explorer: https://compiler-explorer.com/z/ccf6rqenE