aaron.ballman added inline comments.
================ Comment at: clang/test/SemaCXX/cxx2a-consteval.cpp:603 + +long f(); //expected-note {{declared here}} +auto consteval g(auto a) { ---------------- ================ Comment at: clang/test/SemaCXX/cxx2a-consteval.cpp:608 + +auto e = g(f()); // expected-error{{is not a constant expression}} expected-note {{non-constexpr function 'f' cannot be used in a constant expression}} + ---------------- ================ Comment at: clang/test/SemaCXX/cxx2a-consteval.cpp:612 +static_assert(is_same<long, T>::value); + +} // namespace unevaluated ---------------- Here's an interesting test case: ``` #include <typeinfo> struct S { virtual void f(); }; struct D : S { void f() override; }; consteval S *get_s() { return nullptr; } void func() { (void)typeid(*get_s()); } ``` `typeid` still needs to evaluate its operand (due to the polymorphic return type of `*get_s()`), and so you should get a diagnostic about evaluating the side effects by calling `get_s()`. I think this then runs into https://eel.is/c++draft/expr.const#13.sentence-3 and we should diagnose? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106302/new/ https://reviews.llvm.org/D106302 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits