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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-10-11
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
           Keywords|                            |needs-bisection
            Summary|constant expression error   |[14/15/16/17 Regression]
                   |from usage of string        |constant expression error
                   |literal in templated        |from usage of string
                   |contexts                    |literal in templated
                   |                            |contexts
      Known to work|                            |10.5.0
   Target Milestone|---                         |14.5
      Known to fail|                            |11.1.0

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

C++11 example:
```
constexpr  char aa[] = "a";
constexpr  char bb[] = "b";
template<typename T=int>
void constexpr fn() {
    constexpr bool t = true;
    auto constexpr v = t ? aa : bb; // error
}
int main() {
    fn();
}
```

>- The error occurs across all GCC and C++ versions from what I have tested.

Works in GCC 10.5.0 and before.  So 6 years ago.

Reply via email to