[PATCH] D119477: Ignore FullExpr when traversing cast sub-expressions

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 08:19:04 PDT 2022


aaron.ballman added a comment.

The changes here generally look good, and I'm happy to see that more of our test cases are diagnosing similar to other compilers with the changes.



================
Comment at: clang/test/SemaCXX/cxx2a-consteval.cpp:362-364
+  { A k = to_lvalue_ref(A().ret_a()); } // expected-error {{'alloc::A::ret_a' is not a constant expression}} expected-error {{'alloc::to_lvalue_ref' is not a constant expression}}
+  // expected-note at -1 {{temporary created here}}
+  // expected-note at -2 {{heap-allocated object is not a constant expression}} expected-note at -2 {{reference to temporary is not a constant expression}}
----------------
I usually prefer line continuation characters because I think it makes the test easier to read (it's easy to miss secondary diagnostics on the same line). However, I don't insist on these changes either (but if you make them, please do similar for the other test lines you're touching).


================
Comment at: clang/test/SemaCXX/cxx2a-consteval.cpp:365
-  { int k = A().ret_a().ret_i(); }
-  { int k = by_value_a(A()); }
   { int k = const_a_ref(A()); }
----------------
Why are we dropping this test coverage?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119477/new/

https://reviews.llvm.org/D119477



More information about the cfe-commits mailing list