public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107186] New: GCC rejects  use of static constexpr member function in noexcept complete-class context
@ 2022-10-08 17:42 jlame646 at gmail dot com
  2023-08-12  5:15 ` [Bug c++/107186] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: jlame646 at gmail dot com @ 2022-10-08 17:42 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/107186] GCC rejects  use of static constexpr member function in noexcept complete-class context
  2022-10-08 17:42 [Bug c++/107186] New: GCC rejects use of static constexpr member function in noexcept complete-class context jlame646 at gmail dot com
@ 2023-08-12  5:15 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-12  5:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.6.4

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
clang and MSVC also rejects this for the same reason as GCC ...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-12  5:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08 17:42 [Bug c++/107186] New: GCC rejects use of static constexpr member function in noexcept complete-class context jlame646 at gmail dot com
2023-08-12  5:15 ` [Bug c++/107186] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).