aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2000-09-06 09:04:00 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-09-06 09:04:00 +0000
commitc833d2be02e2e98ef83c204734389795e8dd2abd (patch)
tree53de546db89c6fc8948a14b139ddbf921cee40b6
parentb1ce3eb24a65ac83f1ed5dddaf9e1f04afafd41f (diff)
downloadgcc-c833d2be02e2e98ef83c204734389795e8dd2abd.zip
gcc-c833d2be02e2e98ef83c204734389795e8dd2abd.tar.gz
gcc-c833d2be02e2e98ef83c204734389795e8dd2abd.tar.bz2
init.c (build_offset_ref): Deal with namespace scoped TEMPLATE_ID_EXPRs.
* init.c (build_offset_ref): Deal with namespace scoped TEMPLATE_ID_EXPRs. From-SVN: r36189
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/init.c39
2 files changed, 29 insertions, 15 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 744511a0..e5c11ef 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2000-09-06 Nathan Sidwell <nathan@codesourcery.com>
+ * init.c (build_offset_ref): Deal with namespace scoped
+ TEMPLATE_ID_EXPRs.
+
+2000-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
* class.c (resolve_address_of_overloaded_function): Add
explanation message.
* decl.c (define_case_label): Reformat explanation.
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 7d1e3b4..68f92b6 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1624,21 +1624,6 @@ build_offset_ref (type, name)
if (processing_template_decl || uses_template_parms (type))
return build_min_nt (SCOPE_REF, type, name);
- /* Handle namespace names fully here. */
- if (TREE_CODE (type) == NAMESPACE_DECL)
- {
- t = lookup_namespace_name (type, name);
- if (t != error_mark_node && ! type_unknown_p (t))
- {
- mark_used (t);
- t = convert_from_reference (t);
- }
- return t;
- }
-
- if (type == NULL_TREE || ! is_aggr_type (type, 1))
- return error_mark_node;
-
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
/* If the NAME is a TEMPLATE_ID_EXPR, we are looking at
@@ -1666,6 +1651,30 @@ build_offset_ref (type, name)
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
}
+ if (type == NULL_TREE)
+ return error_mark_node;
+
+ /* Handle namespace names fully here. */
+ if (TREE_CODE (type) == NAMESPACE_DECL)
+ {
+ t = lookup_namespace_name (type, name);
+ if (t == error_mark_node)
+ return t;
+ if (TREE_CODE (orig_name) == TEMPLATE_ID_EXPR)
+ /* Reconstruct the TEMPLATE_ID_EXPR. */
+ t = build (TEMPLATE_ID_EXPR, TREE_TYPE (t),
+ t, TREE_OPERAND (orig_name, 1));
+ if (! type_unknown_p (t))
+ {
+ mark_used (t);
+ t = convert_from_reference (t);
+ }
+ return t;
+ }
+
+ if (! is_aggr_type (type, 1))
+ return error_mark_node;
+
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
if (! check_dtor_name (type, name))