add_using_namespace (current_binding_level->using_directives,
ORIGINAL_NAMESPACE (target));
+ bool diagnosed = false;
if (attribs != error_mark_node)
for (tree a = attribs; a; a = TREE_CHAIN (a))
{
inform (DECL_SOURCE_LOCATION (target),
"you can use an inline namespace instead");
}
+ else if ((flag_openmp || flag_openmp_simd)
+ && get_attribute_namespace (a) == omp_identifier
+ && (is_attribute_p ("directive", name)
+ || is_attribute_p ("sequence", name)))
+ {
+ if (!diagnosed)
+ error ("%<omp::%E%> not allowed to be specified in this "
+ "context", name);
+ diagnosed = true;
+ }
else
warning (OPT_Wattributes, "%qD attribute directive ignored", name);
}
[[omp::directive (parallel)]] __extension__ asm (""); // { dg-error "expected" }
__extension__ [[omp::directive (parallel)]] asm (""); // { dg-error "expected" }
[[omp::directive (parallel)]] namespace M = ::N; // { dg-error "expected" }
- [[omp::directive (parallel)]] using namespace N; // { dg-bogus "expected" "" { xfail *-*-* } }
+ [[omp::directive (parallel)]] using namespace N; // { dg-error "not allowed to be specified in this context" }
[[omp::directive (parallel)]] using O::T; // { dg-error "expected" }
[[omp::directive (parallel)]] __label__ foo; // { dg-error "expected" }
[[omp::directive (parallel)]] static_assert (true, ""); // { dg-error "expected" }