public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103092] New: Non-throwing function pointer can point to a throwing-function in C++14
@ 2021-11-05  8:37 fchelnokov at gmail dot com
  2021-11-05  9:20 ` [Bug c++/103092] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: fchelnokov at gmail dot com @ 2021-11-05  8:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103092
           Summary: Non-throwing function pointer can point to a
                    throwing-function in C++14
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

This program
```
void func(){}

int main() {
    void(*pFn)() noexcept(true);
    pFn = func;
    (void)pFn;
}

```
is accepted by GCC in C++14 mode (but not by Clang), demo:
https://gcc.godbolt.org/z/a3EjxcKvz

Starting from C++17, GCC also rejects it. Could you please verify C++14 mode
here?

Related discussion: https://stackoverflow.com/q/66574353/7325599

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

end of thread, other threads:[~2021-11-06  4:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05  8:37 [Bug c++/103092] New: Non-throwing function pointer can point to a throwing-function in C++14 fchelnokov at gmail dot com
2021-11-05  9:20 ` [Bug c++/103092] " redi at gcc dot gnu.org
2021-11-05  9:26 ` redi at gcc dot gnu.org
2021-11-05 22:45 ` pinskia at gcc dot gnu.org
2021-11-06  0:28 ` redi at gcc dot gnu.org
2021-11-06  4:55 ` 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).