MagentaTreehouse

Results comments of MagentaTreehouse

Reduced to valid code: ```c++ template struct A { enum E : T; E h(); }; int b = A{}.h() + 0; ``` Assertion: ``` clang++: /root/llvm-project/clang/lib/AST/ASTContext.cpp:7674: unsigned int clang::ASTContext::getIntegerRank(const...

Reduced: ```c++ int f() { return 0; } void id_print_name() { (int) ((int(*)())f)(); } ``` Stack dump: ``` 0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S...

Looks like clang is correct: the `const C*` overload should not be viable, because `std::size_t(0)` is not an integer literal and cannot be converted to a pointer with a standard...

Tested with local debug build and got stacktrace: ```console 0. Program arguments: /home/treehouse/build/llvm-project-main/Clang_19-Debug/bin/clang-20 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -dumpdir test- -disable-free -clear-ast-before-backend -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno...

Reduced: ```c++ template struct Graph { class NodeId; static constexpr NodeId nil_node_id_{nullptr}; }; ``` Assertion: ```console clang++: /root/llvm-project/clang/include/clang/AST/DeclCXX.h:465: clang::CXXRecordDecl::DefinitionData& clang::CXXRecordDecl::data() const: Assertion `DD && "queried property of class with no...

`U` is deduced to be `CLangTester&` and it wins a "tie breaker" [[over.ics.rank]/3.2.6](https://eel.is/c++draft/over.match#over.ics.rank-3.2.6) against `const CLangTester&`. > Standard conversion sequence S1 is a better conversion sequence than standard conversion sequence...

To generalize further, Clang seems to allow any of the [_ptr-operator_](https://timsong-cpp.github.io/cppwp/dcl.decl.general#nt:ptr-operator)s in the _ptr-declarator_ for [constructors](https://timsong-cpp.github.io/cppwp/class.ctor#general-1) and [destructors](https://timsong-cpp.github.io/cppwp/class.dtor#1). Consider also these accepts-invalid cases: https://compiler-explorer.com/z/qdbdsjbWh ```c++ struct A { *&A(); };...

Reduced: ```c++ template struct int_sequence {}; template using element_t = int; template void parseRequestVariant() { [](int_sequence) -> void { ( [] { using T = element_t; }, ...); }(int_sequence{}); }...

> This is what [p0527](https://wg21.link/p0527) and subsequently [p1825](https://wg21.link/p1825) fixed in C++20 but the example 2 was explicitly in p0527 as IF in C++17 P1825 was applied as a DR in...