Closed BaLiKfromUA closed 6 days ago
Addresses #11
> env LIT_FILTER=cxx2x-ambig-reflect-expr.cpp ninja check-clang -C build-llvm/
ninja: Entering directory `build-llvm/' [89/90] Running the Clang regression tests llvm-lit: /home/balik/Desktop/clang-p2996/llvm/utils/lit/lit/llvm/config.py:509: note: using clang: /home/balik/Desktop/clang-p2996/build-llvm/bin/clang
Testing Time: 0.04s
Total Discovered Tests: 19357 Excluded: 19356 (99.99%) Passed : 1 (0.01%)
- Manually tested by compiling a code with mentioned issue ```cpp #include <experimental/meta> #include <iostream> enum MyEnum { x, y, e = -1, f, z = 99 }; int main() { MyEnum value{}; constexpr auto reflValue = ^value; if (reflValue != ^MyEnum && true) { std::cout << "YES" << std::endl; } else { std::cout << "NO" << std::endl; } }
> build-llvm/bin/clang++ -std=c++26 -freflection -Wl,-rpath,/home/balik/Development/clang-p2996/build-llvm/lib/x86_64-unknown-linux-gnu -L/home/balik/Development/clang-p2996/build-llvm/lib/x86_64-unknown-linux-gnu -stdlib=libc++ -lc++ -lc++abi -o a.out main.cpp main.cpp:10:28: warning: given expression may be misinterpreted due to 'T &&' type parsing logic. did you mean '... (^T) && ...'? 10 | if (reflValue != ^MyEnum && true) { | ^ main.cpp:10:31: error: expected ')' 10 | if (reflValue != ^MyEnum && true) { | ^ main.cpp:10:6: note: to match this '(' 10 | if (reflValue != ^MyEnum && true) { | ^ 1 warning and 1 error generated.
PR is ready for review IMO.
Last issue left on my side:
T
Gonna open another PR once I found proper solution
Addresses #11
Testing performed
ninja: Entering directory `build-llvm/' [89/90] Running the Clang regression tests llvm-lit: /home/balik/Desktop/clang-p2996/llvm/utils/lit/lit/llvm/config.py:509: note: using clang: /home/balik/Desktop/clang-p2996/build-llvm/bin/clang
Testing Time: 0.04s
Total Discovered Tests: 19357 Excluded: 19356 (99.99%) Passed : 1 (0.01%)
Additional context
PR is ready for review IMO.
Last issue left on my side:
T
. Should be possible but need more investigation.