https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107186
Bug ID: 107186
Summary: GCC rejects use of static constexpr member function
in noexcept complete-class context
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jlame646 at gmail dot com
Target Milestone: ---
The following valid program is rejected by gcc as well as other compilers:
```
struct A {
constexpr static bool func()
{
return true;
}
//--------------vvvvvv------->works as expected #1
void f(bool V1 = func())
{
bool V2 = func(); //works as expected #2
}
//-----------------vvvvvv---->DOESN'T WORK? #3
void g() noexcept(func())
{
;
}
};
```
>From [class.mem.general](https://eel.is/c++draft/class.mem.general#7.4):
> A complete-class context of a class is a
>
> * noexcept specifier
As we can see the noexcept speficier is included in the complete-class context
so the `#3` should work.