public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65382] New: pointer-to-noexcept-function typealias allowed via using
@ 2015-03-10 22:30 vgheorgh at gmail dot com
  2015-03-10 22:31 ` [Bug c++/65382] " vgheorgh at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vgheorgh at gmail dot com @ 2015-03-10 22:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65382
           Summary: pointer-to-noexcept-function typealias allowed via
                    using
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vgheorgh at gmail dot com

According to 15.4 Exception specifications [except.spec]/2, the following code
should be rejected, 

#include <iostream>

using fptr = void(*)() noexcept; // should not be accepted
// typedef void (*FPTR)() noexcept; // rejected by the compiler

void f() noexcept
{
    std::cout << "void f() noexcept" << std::endl;
}

int main()
{
    fptr fp = f;
    fp();
}


Replacing using with a typedef makes the compiler emit an error, however the
code above compiles just fine, and it shouldn't.


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

end of thread, other threads:[~2021-07-24 16:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 22:30 [Bug c++/65382] New: pointer-to-noexcept-function typealias allowed via using vgheorgh at gmail dot com
2015-03-10 22:31 ` [Bug c++/65382] " vgheorgh at gmail dot com
2015-03-10 22:36 ` redi at gcc dot gnu.org
2015-05-11 16:44 ` vgheorgh at gmail dot com
2015-05-11 16:56 ` vgheorgh at gmail dot com
2021-07-24 16:33 ` [Bug c++/65382] [C++11/14 only] " pinskia at gcc dot gnu.org
2021-07-24 16:37 ` 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).