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

* [Bug c++/65382] pointer-to-noexcept-function typealias allowed via using
  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 ` vgheorgh at gmail dot com
  2015-03-10 22:36 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vgheorgh at gmail dot com @ 2015-03-10 22:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Vlad Gheorghiu <vgheorgh at gmail dot com> ---
I compiled with gcc5 and also with gcc4.9.2, using `-Wall -Wextra -pedantic`


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

* [Bug c++/65382] pointer-to-noexcept-function typealias allowed via using
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-10 22:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-10
     Ever confirmed|0                           |1


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

* [Bug c++/65382] pointer-to-noexcept-function typealias allowed via using
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vgheorgh at gmail dot com @ 2015-05-11 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Vlad Gheorghiu <vgheorgh at gmail dot com> ---
More details: http://stackoverflow.com/q/30172483/3093378


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

* [Bug c++/65382] pointer-to-noexcept-function typealias allowed via using
  2015-03-10 22:30 [Bug c++/65382] New: pointer-to-noexcept-function typealias allowed via using vgheorgh at gmail dot com
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: vgheorgh at gmail dot com @ 2015-05-11 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Vlad Gheorghiu <vgheorgh at gmail dot com> ---
Please ignore the previous comment, posted by mistake for another bug I
reported


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

* [Bug c++/65382] [C++11/14 only] pointer-to-noexcept-function typealias allowed via using
  2015-03-10 22:30 [Bug c++/65382] New: pointer-to-noexcept-function typealias allowed via using vgheorgh at gmail dot com
                   ` (3 preceding siblings ...)
  2015-05-11 16:56 ` vgheorgh at gmail dot com
@ 2021-07-24 16:33 ` pinskia at gcc dot gnu.org
  2021-07-24 16:37 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-24 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|pointer-to-noexcept-functio |[C++11/14 only]
                   |n typealias allowed via     |pointer-to-noexcept-functio
                   |using                       |n typealias allowed via
                   |                            |using

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
C++11:
An exception-specification shall not appear in a typedef declaration or
alias-declaration. 

But C++17 removed that restriction.

The question becomes how important is this now the restriction is gone in new
C++ standard and GCC moved to C++17 by default already.

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

* [Bug c++/65382] [C++11/14 only] pointer-to-noexcept-function typealias allowed via using
  2015-03-10 22:30 [Bug c++/65382] New: pointer-to-noexcept-function typealias allowed via using vgheorgh at gmail dot com
                   ` (4 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-24 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kariya_mitsuru at hotmail dot com

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 63290 has been marked as a duplicate of this bug. ***

^ 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).