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

            Bug ID: 110106
           Summary: ICE on noexcept(noexcept(...)) with optional
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stevenxia990430 at gmail dot com
  Target Milestone: ---

The following program produces internal compiler error: Segmentation fault.
Tested on GCC-trunk. Note replacing the std::optional<int>{z} inside the
noexcept with just {z} compiles with failure. 

To quickly reproduce: https://gcc.godbolt.org/z/dhjETE7K3
```
#include <optional>

namespace x {
void y(std::optional<int> z) noexcept(noexcept(std::optional<int>{z})) {}
}

int main() {

}
```


tested this on clang-trunk and it successfully compiles.

Reply via email to