2007-12-10 Simon Martin <simartin@users.sourceforge.net>
PR c++/34059
* typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
gcc/testsuite/
2007-12-10 Simon Martin <simartin@users.sourceforge.net>
PR c++/34059
* g++.dg/parse/crash40.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130754
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-12-10 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/34059
+ * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
+ MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
+
2007-12-10 Jakub Jelinek <jakub@redhat.com>
PR c++/34395
warn_deprecated_use (member);
}
else
- member_scope = BINFO_TYPE (BASELINK_BINFO (member));
+ member_scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (member));
/* If MEMBER is from an anonymous aggregate, MEMBER_SCOPE will
presently be the anonymous union. Go outwards until we find a
type related to OBJECT_TYPE. */
+2007-12-10 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/34059
+ * g++.dg/parse/crash40.C: New test.
+
2007-12-10 Eric Botcazou <ebotcazou@libertysurf.fr>
* g++.dg/opt/memcpy1.C: New test.
--- /dev/null
+/* PR c++/34059 */
+/* { dg-do "compile" } */
+
+struct A
+{
+ template<int> void foo();
+};
+struct B : A {};
+struct C : A {};
+
+class AA
+{
+ template<int> void foo(); /* { dg-error "is private" } */
+};
+struct BB : AA {};
+
+class AAA {
+ int get() const {}
+};
+struct BBB {
+ static BBB *foo();
+private:
+ int get() const {} /* { dg-error "is private" } */
+};
+template<bool> struct S {
+ S(unsigned int = BBB::foo()->AAA::get()); /* { dg-error "is not a base of" } */
+};
+template<bool> struct SS {
+ SS(unsigned int = BBB::foo()->get());
+};
+
+void bar()
+{
+ B().C::foo<0>(); /* { dg-error "is not a member of" } */
+ BB().AA::foo<0>(); /* { dg-error "within this context" } */
+
+ int i;
+ i.C::foo<0>(); /* { dg-error "which is of non-class type" } */
+
+ S<false> s;
+ SS<false> ss; /* { dg-error "within this context" } */
+}