From db3a95196c3192a488ad6ece2ea9057915d2c3a6 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Fri, 15 Oct 2004 14:30:21 +0000 Subject: [multiple changes] 2004-10-13 Andrew Pinski PR c++/16301 * name-lookup.c (parse_using_directive): If we have a error_mark_node, do not set the decl namespace associations on it. 2004-10-14 Andrew Pinski PR c++/16301 * g++.dg/lookup/strong-using-4.C: New test. From-SVN: r89093 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/name-lookup.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/lookup/strong-using-4.C | 8 ++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/lookup/strong-using-4.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8ae05c0..d970b5a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-10-13 Andrew Pinski + + PR c++/16301 + * name-lookup.c (parse_using_directive): If we have a + error_mark_node, do not set the decl namespace associations + on it. + 2004-10-14 Mark Mitchell PR c++/17976 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index b7e29aa..6634f87 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3422,7 +3422,7 @@ parse_using_directive (tree namespace, tree attribs) { if (!toplevel_bindings_p ()) error ("strong using only meaningful at namespace scope"); - else + else if (namespace != error_mark_node) DECL_NAMESPACE_ASSOCIATIONS (namespace) = tree_cons (current_namespace, 0, DECL_NAMESPACE_ASSOCIATIONS (namespace)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 85801a8..ebee962 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2004-10-14 Andrew Pinski + PR c++/16301 + * g++.dg/lookup/strong-using-4.C: New test. + +2004-10-14 Andrew Pinski + PR middle-end/16567 * gcc.c-torture/compile/nested-1.c: New test. diff --git a/gcc/testsuite/g++.dg/lookup/strong-using-4.C b/gcc/testsuite/g++.dg/lookup/strong-using-4.C new file mode 100644 index 0000000..5ea1784 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/strong-using-4.C @@ -0,0 +1,8 @@ +// PR c++/16301 + +// { dg-do compile } + +namespace NS2 +{ + using namespace NS1 __attribute__ ((strong)); // { dg-error "" } +} -- cgit v1.1