Commit 522da2bf by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/9447 (using Base<T>::member does not work)

cp:
	PR c++/9447
	* decl2.c (do_class_using_decl): Set type to NULL_TREE.
	* semantics.c (finish_expr_stmt): Do not convert to void in a
	template.
testsuite:
	PR c++/9447
	* g++.dg/template/using5.C: New test.

From-SVN: r70039
parent e9c00e62
2003-08-01 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9447
* decl2.c (do_class_using_decl): Set type to NULL_TREE.
* semantics.c (finish_expr_stmt): Do not convert to void in a
template.
2003-07-31 Nathan Sidwell <nathan@codesourcery.com> 2003-07-31 Nathan Sidwell <nathan@codesourcery.com>
* pt.c (coerce_template_parms): Refactor. * pt.c (coerce_template_parms): Refactor.
......
...@@ -4096,7 +4096,7 @@ do_class_using_decl (tree decl) ...@@ -4096,7 +4096,7 @@ do_class_using_decl (tree decl)
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 980716); my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 980716);
value = build_lang_decl (USING_DECL, name, unknown_type_node); value = build_lang_decl (USING_DECL, name, NULL_TREE);
DECL_INITIAL (value) = TREE_OPERAND (decl, 0); DECL_INITIAL (value) = TREE_OPERAND (decl, 0);
return value; return value;
} }
......
...@@ -430,7 +430,7 @@ finish_expr_stmt (tree expr) ...@@ -430,7 +430,7 @@ finish_expr_stmt (tree expr)
/* Remember the type of the expression. */ /* Remember the type of the expression. */
expr_type = TREE_TYPE (expr); expr_type = TREE_TYPE (expr);
if (stmts_are_full_exprs_p ()) if (!processing_template_decl && stmts_are_full_exprs_p ())
expr = convert_to_void (expr, "statement"); expr = convert_to_void (expr, "statement");
r = add_stmt (build_stmt (EXPR_STMT, expr)); r = add_stmt (build_stmt (EXPR_STMT, expr));
......
2003-08-01 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9447
* g++.dg/template/using5.C: New test.
2003-07-31 Roger Sayle <roger@eyesopen.com> 2003-07-31 Roger Sayle <roger@eyesopen.com>
* gcc.dg/builtins-27.c: New test case. * gcc.dg/builtins-27.c: New test case.
......
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 31 Jul 2003 <nathan@codesourcery.com>
// PR 9447. further test cases for dependent using decl
template <typename T> struct Base;
template <typename T> struct Derived : public Base<T> {
using Base<T>::i;
Derived() { i; }
int get_i() { return i.f(); }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment