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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |55004
            Summary|[12/13/14/15 Regression]    |[12/13/14/15 Regression]
                   |Nested statement            |statement expressions as
                   |expressions with decltype   |initializer for decltype
                   |auto in template break      |auto breaks in templates
                   |                            |with optimization turned on
             Status|WAITING                     |NEW

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

Reduced testcase:
```
template <typename>
void fn() {
  decltype(auto) v = ({3;});  // breaks
}
```

Fails at -O1+. Most likely a check for optimization in the front-end trying to
optimize the initializer and using the const expression path for that.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
[Bug 55004] [meta-bug] constexpr issues

Reply via email to