On 11/18/26 1:00 PM, Marek Polacek wrote:
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?

OK.

-- >8 --
This error path fails to set *non_constant_p.

gcc/cp/ChangeLog:

        * reflect.cc (get_meta_exception_object): Set *non_constant_p
        after giving an error.
---
  gcc/cp/reflect.cc | 1 +
  1 file changed, 1 insertion(+)

diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc
index 4137fb64e75..2b3c4755186 100644
--- a/gcc/cp/reflect.cc
+++ b/gcc/cp/reflect.cc
@@ -1134,6 +1134,7 @@ get_meta_exception_object (location_t loc, const 
constexpr_ctx *ctx,
    if (TREE_CODE (type) != TYPE_DECL || !CLASS_TYPE_P (TREE_TYPE (type)))
      {
        error_at (loc, "couldn%'t throw %qs", "std::meta::exception");
+      *non_constant_p = true;
        return NULL_TREE;
      }
    type = TREE_TYPE (type);

base-commit: ccba72f71e192d8448c457e4a469e86c7ed71aac

Reply via email to