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
This commit is contained in:
parent
e9c00e62d0
commit
522da2bf7e
5 changed files with 31 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
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>
|
||||
|
||||
* pt.c (coerce_template_parms): Refactor.
|
||||
|
|
|
@ -4096,7 +4096,7 @@ do_class_using_decl (tree decl)
|
|||
|
||||
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);
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -430,7 +430,7 @@ finish_expr_stmt (tree expr)
|
|||
/* Remember the type of the expression. */
|
||||
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");
|
||||
|
||||
r = add_stmt (build_stmt (EXPR_STMT, expr));
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
* gcc.dg/builtins-27.c: New test case.
|
||||
|
|
17
gcc/testsuite/g++.dg/template/using5.C
Normal file
17
gcc/testsuite/g++.dg/template/using5.C
Normal file
|
@ -0,0 +1,17 @@
|
|||
// { 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(); }
|
||||
|
||||
};
|
Loading…
Add table
Reference in a new issue