aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-07-29 11:16:50 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-07-29 11:16:50 +0000
commit399dedb996c18f40e5eb60d8707d86701b27db0e (patch)
treef933bf28ffc6e8514814d1f5e3aab7549afff83b /gcc/cp/parser.c
parent16ff3a23ffdeb49c8b0b8672bbd26bdcd06681e4 (diff)
downloadgcc-399dedb996c18f40e5eb60d8707d86701b27db0e.zip
gcc-399dedb996c18f40e5eb60d8707d86701b27db0e.tar.gz
gcc-399dedb996c18f40e5eb60d8707d86701b27db0e.tar.bz2
re PR c++/9447 (using Base<T>::member does not work)
cp: PR c++/9447 * decl.c (add_binding): Add bval local variable. (push_class_level_binding): Likewise. Allow a USING_DECL to be pushed. * decl2.c (do_class_using_decl): The type of a using decl is unknown. * parser.c (cp_parser_postfix_expression): Refactor unqualified-id function call lookup code. * pt.c (tsubst): A USING_DECL will have unknown type. (tsubst_copy_and_build): Allow a using decl. (type_dependent_expression_p): A USING_DECL will make it dependent. * semantics.c (finish_member_declaration): Push a dependent using declaration. testsuite: PR c++/9447 * g++.dg/template/using1.C: New test. * g++.dg/template/using2.C: New test. * g++.dg/template/using3.C: New test. * g++.dg/template/using4.C: New test. From-SVN: r69921
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 00f1c6e..3aa684b 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -3483,18 +3483,19 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
parser->non_constant_expression_p = true;
}
- if (idk == CP_ID_KIND_UNQUALIFIED
- && (is_overloaded_fn (postfix_expression)
- || DECL_P (postfix_expression)
- || TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
- && args)
- postfix_expression
- = perform_koenig_lookup (postfix_expression, args);
- else if (idk == CP_ID_KIND_UNQUALIFIED
- && TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
- postfix_expression
- = unqualified_fn_lookup_error (postfix_expression);
-
+ if (idk == CP_ID_KIND_UNQUALIFIED)
+ {
+ if (args
+ && (is_overloaded_fn (postfix_expression)
+ || DECL_P (postfix_expression)
+ || TREE_CODE (postfix_expression) == IDENTIFIER_NODE))
+ postfix_expression
+ = perform_koenig_lookup (postfix_expression, args);
+ else if (TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
+ postfix_expression
+ = unqualified_fn_lookup_error (postfix_expression);
+ }
+
if (TREE_CODE (postfix_expression) == COMPONENT_REF)
{
tree instance = TREE_OPERAND (postfix_expression, 0);