re PR c++/12397 (two-stage name lookup argument shadowed by global type)
PR c++/12397 * typeck.c (finish_class_member_access_expr): Don't tree IDENTIFIER_NODEs as non-dependent expressions. PR c++/12397 * g++.dg/template/lookup3.C: New test. From-SVN: r74949
This commit is contained in:
parent
a6444561cb
commit
1ffe6573a9
@ -1,3 +1,9 @@
|
||||
2003-12-22 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/12397
|
||||
* typeck.c (finish_class_member_access_expr): Don't tree
|
||||
IDENTIFIER_NODEs as non-dependent expressions.
|
||||
|
||||
2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR c++/5050
|
||||
|
@ -1809,6 +1809,9 @@ finish_class_member_access_expr (tree object, tree name)
|
||||
{
|
||||
if (/* If OBJECT_TYPE is dependent, so is OBJECT.NAME. */
|
||||
dependent_type_p (object_type)
|
||||
/* If NAME is just an IDENTIFIER_NODE, then the expression
|
||||
is dependent. */
|
||||
|| TREE_CODE (object) == IDENTIFIER_NODE
|
||||
/* If NAME is "f<args>", where either 'f' or 'args' is
|
||||
dependent, then the expression is dependent. */
|
||||
|| (TREE_CODE (name) == TEMPLATE_ID_EXPR
|
||||
|
@ -1,3 +1,8 @@
|
||||
2003-12-22 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/12397
|
||||
* g++.dg/template/lookup3.C: New test.
|
||||
|
||||
2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
* g++.dg/template/recurse1.C: New test
|
||||
|
16
gcc/testsuite/g++.dg/template/lookup3.C
Normal file
16
gcc/testsuite/g++.dg/template/lookup3.C
Normal file
@ -0,0 +1,16 @@
|
||||
// PR c++/12397
|
||||
|
||||
struct foo { };
|
||||
|
||||
template <typename T> struct bar
|
||||
{
|
||||
bar(){}
|
||||
int i;
|
||||
bar (const bar<T>& foo) : i (foo.i) {}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
bar<int> b1;
|
||||
bar<int> b2(b1);
|
||||
}
|
Loading…
Reference in New Issue
Block a user