* semantics.c (finish_non_static_data_member): Don't check
derivation in a template.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154150
138bc75d-0d04-0410-961f-
82ee72b054a4
2009-11-13 Jason Merrill <jason@redhat.com>
2009-11-13 Jason Merrill <jason@redhat.com>
+ PR c++/21008, DR 515
+ * semantics.c (finish_non_static_data_member): Don't check
+ derivation in a template.
+
PR c++/11987
* parser.c (cp_parser_direct_declarator): Give helpful error about
trying to define member of a dependent typedef.
PR c++/11987
* parser.c (cp_parser_direct_declarator): Give helpful error about
trying to define member of a dependent typedef.
return build_min (COMPONENT_REF, type, object, decl, NULL_TREE);
}
return build_min (COMPONENT_REF, type, object, decl, NULL_TREE);
}
+ /* If PROCESSING_TEMPLATE_DECL is nonzero here, then
+ QUALIFYING_SCOPE is also non-null. Wrap this in a SCOPE_REF
+ for now. */
+ else if (processing_template_decl)
+ return build_qualified_name (TREE_TYPE (decl),
+ qualifying_scope,
+ DECL_NAME (decl),
+ /*template_p=*/false);
else
{
tree access_type = TREE_TYPE (object);
else
{
tree access_type = TREE_TYPE (object);
- /* If PROCESSING_TEMPLATE_DECL is nonzero here, then
- QUALIFYING_SCOPE is also non-null. Wrap this in a SCOPE_REF
- for now. */
- if (processing_template_decl)
- return build_qualified_name (TREE_TYPE (decl),
- qualifying_scope,
- DECL_NAME (decl),
- /*template_p=*/false);
-
perform_or_defer_access_check (TYPE_BINFO (access_type), decl,
decl);
perform_or_defer_access_check (TYPE_BINFO (access_type), decl,
decl);
2009-11-13 Jason Merrill <jason@redhat.com>
2009-11-13 Jason Merrill <jason@redhat.com>
+ PR c++/21008, DR 515
+ * g++.dg/template/inherit4.C: New.
+ * g++.dg/lookup/scoped8.C: Adjust.
+
PR c++/11987
* g++.dg/parse/typename11.C: New.
* g++.dg/template/crash48.C: Adjust.
PR c++/11987
* g++.dg/parse/typename11.C: New.
* g++.dg/template/crash48.C: Adjust.
{
int foo() { return A::i; } // { dg-error "this location" }
};
{
int foo() { return A::i; } // { dg-error "this location" }
};
--- /dev/null
+// PR c++/21008, DR 515
+
+struct A {
+ int foo_;
+};
+template <typename T> struct B: public A { };
+template <typename T> struct C: B<T> {
+ int foo() {
+ return A::foo_; // #1
+ }
+};
+int f(C<int>* p) {
+ return p->foo();
+}