public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "eracpp at eml dot cc" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94944] New: compile error accessing member function of dependent base class template in exception specification Date: Mon, 04 May 2020 15:39:06 +0000 [thread overview] Message-ID: <bug-94944-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94944 Bug ID: 94944 Summary: compile error accessing member function of dependent base class template in exception specification Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eracpp at eml dot cc Target Milestone: --- GCC fails to compile a qualified invocation of a member function of a dependent base class template when used within an exception specification: ---- template <typename T> struct B { void foo(T t) {} }; template <typename T> struct D : B<T> { void foo(T t) noexcept(noexcept(B<T>::foo(t))) {} }; template struct D<int>; ---- The error message is as follows: ---- error: cannot call member function 'void B<T>::foo(T) [with T = int]' without object 8 | void foo(T t) noexcept(noexcept(B<T>::foo(t))) {} | ---- Clang and MSVC accept the code as given without error: https://gcc.godbolt.org/z/MW2iQz Note, a workaround accepted by all three major compilers is to qualify the invocation with `this->`: ---- void foo(T t) noexcept(noexcept(this->B<T>::foo(t))) {} ----
next reply other threads:[~2020-05-04 15:39 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-04 15:39 eracpp at eml dot cc [this message] 2020-05-04 15:41 ` [Bug c++/94944] " eracpp at eml dot cc 2020-05-04 15:56 ` mpolacek at gcc dot gnu.org 2021-12-09 1:46 ` [Bug c++/94944] compile error accessing member function of dependent base class template in noexcept specification pinskia at gcc dot gnu.org 2022-02-16 21:14 ` pinskia at gcc dot gnu.org 2022-02-17 14:14 ` ppalka at gcc dot gnu.org 2022-02-18 1:22 ` cvs-commit at gcc dot gnu.org 2022-02-18 1:24 ` ppalka at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-94944-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).