public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58040] New: Cannot take address-of public using-declaration of member from protected base class
@ 2013-08-01  6:51 gcc at mattwhitlock dot name
  2013-08-01  7:43 ` [Bug c++/58040] " daniel.kruegler at googlemail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gcc at mattwhitlock dot name @ 2013-08-01  6:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58040

            Bug ID: 58040
           Summary: Cannot take address-of public using-declaration of
                    member from protected base class
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at mattwhitlock dot name

$ cat <<EOF > test.cpp
struct Base {
    void foo() { }
    void bar() { }
};

struct Derived : protected Base {
    void foo() { this->Base::foo(); }
    using Base::bar;
};

int main() {
    Derived d;
    d.foo(); // OK
    d.bar(); // OK
    d.Derived::foo(); // OK
    d.Derived::bar(); // OK
    (d.*&Derived::foo)(); // OK
    (d.*&Derived::bar)(); // error
}
EOF

$ g++-4.7.3 --version | head -n1
g++ (Gentoo 4.7.3 p1.0, pie-0.5.5) 4.7.3

$ g++-4.7.3 test.cpp
test.cpp: In function 'int main()':
test.cpp:18:19: error: 'Base' is an inaccessible base of 'Derived'

$ g++-4.8.1 --version | head -n1
g++-4.8.1 (Gentoo 4.8.1 p1.0, pie-0.5.6) 4.8.1

$ g++-4.8.1 test.cpp
test.cpp: In function 'int main()':
test.cpp:18:19: error: 'Base' is an inaccessible base of 'Derived'
     (d.*&Derived::bar)(); // error
                   ^


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

end of thread, other threads:[~2021-08-04 18:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01  6:51 [Bug c++/58040] New: Cannot take address-of public using-declaration of member from protected base class gcc at mattwhitlock dot name
2013-08-01  7:43 ` [Bug c++/58040] " daniel.kruegler at googlemail dot com
2013-08-01  9:27 ` paolo.carlini at oracle dot com
2013-08-02  8:35 ` fabien at gcc dot gnu.org
2013-08-02  8:46 ` paolo.carlini at oracle dot com
2021-07-23 20:45 ` pinskia at gcc dot gnu.org
2021-08-04  7:35 ` pinskia at gcc dot gnu.org
2021-08-04 16:13 ` gcc at mattwhitlock dot name
2021-08-04 16:25 ` redi at gcc dot gnu.org
2021-08-04 17:38 ` gcc at mattwhitlock dot name
2021-08-04 18:58 ` redi 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).