Commit f12ea6ac by Marek Polacek Committed by Marek Polacek

name-lookup.c (finish_using_directive): Don't issue inform() if the warning didn't trigger.

	* name-lookup.c (finish_using_directive): Don't issue inform() if the
	warning didn't trigger.  Add quoting.  Tweak the inform message.

	* g++.dg/lookup/strong-using2.C: New test.

From-SVN: r271432
parent 8d25372f
......@@ -3,6 +3,9 @@
* pt.c (convert_template_argument): Add a diagnostic for the
[temp.arg]/2 ambiguity case.
* name-lookup.c (finish_using_directive): Don't issue inform() if the
warning didn't trigger. Add quoting. Tweak the inform message.
2019-05-20 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h: Remove remnants of CONV_NONCONVERTING.
......
......@@ -7258,10 +7258,10 @@ finish_using_directive (tree target, tree attribs)
if (current_binding_level->kind == sk_namespace
&& is_attribute_p ("strong", name))
{
warning (0, "strong using directive no longer supported");
if (CP_DECL_CONTEXT (target) == current_namespace)
if (warning (0, "%<strong%> using directive no longer supported")
&& CP_DECL_CONTEXT (target) == current_namespace)
inform (DECL_SOURCE_LOCATION (target),
"you may use an inline namespace instead");
"you can use an inline namespace instead");
}
else
warning (OPT_Wattributes, "%qD attribute directive ignored", name);
......
......@@ -4,6 +4,8 @@
* g++.dg/cpp2a/nontype-class17.C: New test.
* g++.dg/lookup/strong-using2.C: New test.
2019-05-20 Jeff Law <law@redhat.com>
* gcc.dg/Wtype-limits-Wextra.c: Adjust expected output after
......
// { dg-do compile { target c++11 } }
// { dg-options "-w" }
namespace A
{
namespace B // { dg-bogus "inline namespace" }
{
}
using namespace B __attribute__ ((strong)); // { dg-bogus "no longer supported" }
}
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