re PR c++/16021 (Tests for container swap specialisations FAIL in debug mode)
PR c++/16021 * name-lookup.c (parse_using_directive): Require strong using to name a nested namespace. From-SVN: r110282
This commit is contained in:
parent
9391bc0df9
commit
9deb204a5a
@ -1,3 +1,9 @@
|
||||
2006-01-26 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/16021
|
||||
* name-lookup.c (parse_using_directive): Require strong using to
|
||||
name a nested namespace.
|
||||
|
||||
2006-01-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
Revert:
|
||||
|
@ -3295,9 +3295,14 @@ parse_using_directive (tree namespace, tree attribs)
|
||||
if (!toplevel_bindings_p ())
|
||||
error ("strong using only meaningful at namespace scope");
|
||||
else if (namespace != error_mark_node)
|
||||
DECL_NAMESPACE_ASSOCIATIONS (namespace)
|
||||
= tree_cons (current_namespace, 0,
|
||||
DECL_NAMESPACE_ASSOCIATIONS (namespace));
|
||||
{
|
||||
if (!is_ancestor (current_namespace, namespace))
|
||||
error ("current namespace %qD does not enclose strongly used namespace %qD",
|
||||
current_namespace, namespace);
|
||||
DECL_NAMESPACE_ASSOCIATIONS (namespace)
|
||||
= tree_cons (current_namespace, 0,
|
||||
DECL_NAMESPACE_ASSOCIATIONS (namespace));
|
||||
}
|
||||
}
|
||||
else
|
||||
warning (OPT_Wattributes, "%qD attribute directive ignored", name);
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
namespace foo {
|
||||
template <class T> void swap(T, T);
|
||||
}
|
||||
namespace fool {
|
||||
namespace foo {
|
||||
template <class T> void swap(T, T);
|
||||
}
|
||||
using namespace foo __attribute__((strong));
|
||||
template <class T> void swap(T);
|
||||
}
|
||||
|
@ -2,16 +2,16 @@
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
namespace foo_impl {
|
||||
class T; // { dg-error "T" "" }
|
||||
}
|
||||
namespace bar_impl {
|
||||
class T; // { dg-error "T" "" }
|
||||
}
|
||||
namespace foo {
|
||||
namespace foo_impl {
|
||||
class T; // { dg-error "T" "" }
|
||||
}
|
||||
using namespace foo_impl __attribute__((strong));
|
||||
}
|
||||
namespace bar {
|
||||
namespace bar_impl {
|
||||
class T; // { dg-error "T" "" }
|
||||
}
|
||||
using namespace bar_impl __attribute__((strong));
|
||||
using namespace foo;
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
namespace foo {
|
||||
template <class T> void f(T, T);
|
||||
}
|
||||
namespace bar {
|
||||
namespace foo {
|
||||
template <class T> void f(T, T);
|
||||
}
|
||||
using namespace foo __attribute__((strong));
|
||||
template <class T> void f(T);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user