summaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-16 23:29:25 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-16 23:29:25 +0000
commit6dd3a38d06b493341de6a1bd307fa66b8a10462d (patch)
treed01fd61cab03b29407d10ef9f75bd71d4bae928a /gcc/cp/search.c
parente01b36b0e51501e657b27828a99f8940ce52aee4 (diff)
downloadgcc-6dd3a38d06b493341de6a1bd307fa66b8a10462d.tar.gz
PR c++/13950, DR 176
* search.c (lookup_field_r): Allow lookup to find the injected-class-name from a template base. (template_self_reference_p): Remove. * decl.c (make_typename_type): Diagnose ambiguity. Use maybe_get_template_decl_from_type_decl. * parser.c (cp_parser_template_name): Pass true to is_template rather than use maybe_get_template_decl_from_type_decl. (cp_parser_lookup_name): Use maybe_get_template_decl_from_type_decl. * pt.c (maybe_get_template_decl_from_type_decl): Handle ambiguity. Use DECL_SELF_REFERENCE_P. * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Avoid duplicate ambiguity error. * error.c (dump_decl): Don't say "typedef" for injected-class-name. * pt.c (convert_template_argument): Tweak logic. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154223 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 3adf9e0a1ab..3e9bec011ff 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -63,7 +63,6 @@ static tree dfs_access_in_type (tree, void *);
static access_kind access_in_type (tree, tree);
static int protected_accessible_p (tree, tree, tree);
static int friend_accessible_p (tree, tree, tree);
-static int template_self_reference_p (tree, tree);
static tree dfs_get_pure_virtuals (tree, void *);
@@ -955,24 +954,6 @@ struct lookup_field_info {
const char *errstr;
};
-/* Within the scope of a template class, you can refer to the to the
- current specialization with the name of the template itself. For
- example:
-
- template <typename T> struct S { S* sp; }
-
- Returns nonzero if DECL is such a declaration in a class TYPE. */
-
-static int
-template_self_reference_p (tree type, tree decl)
-{
- return (CLASSTYPE_USE_TEMPLATE (type)
- && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))
- && TREE_CODE (decl) == TYPE_DECL
- && DECL_ARTIFICIAL (decl)
- && DECL_NAME (decl) == constructor_name (type));
-}
-
/* Nonzero for a class member means that it is shared between all objects
of that class.
@@ -1092,11 +1073,6 @@ lookup_field_r (tree binfo, void *data)
}
}
- /* You must name a template base class with a template-id. */
- if (!same_type_p (type, lfi->type)
- && template_self_reference_p (type, nval))
- goto done;
-
/* If the lookup already found a match, and the new value doesn't
hide the old one, we might have an ambiguity. */
if (lfi->rval_binfo