https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124417

            Bug ID: 124417
           Summary: [reflection] constexpr exceptions v. -fno-exceptions
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

```
#include <meta>

consteval bool
foo ()
{
  try {
    bool b = is_enum_type (^^::);
  }
  catch (std::meta::exception &) { return true; }
  return false;
}

static_assert (foo ());
```

with -std=c++26 -freflection -fno-exceptions

says

ex.C: In function ‘consteval bool foo()’:
ex.C:9:31: error: exception handling disabled, use ‘-fexceptions’ to enable

The error is coming from doing_eh but if I disable the error, the test case
works fine!

Reply via email to