From: Paolo Carlini Date: Fri, 11 Apr 2014 17:36:44 +0000 (+0000) Subject: re PR c++/58600 ([c++11] ICE on wrong usage of alignas) X-Git-Tag: releases/gcc-5.1.0~8180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b255e8f36ac3f4d8e3fc2cc67cc757ee5682e3b;p=thirdparty%2Fgcc.git re PR c++/58600 ([c++11] ICE on wrong usage of alignas) /cp 2014-04-11 Paolo Carlini PR c++/58600 * name-lookup.c (parse_using_directive): Return early if the attribs argument is error_mark_node; use get_attribute_name. /testsuite 2014-04-11 Paolo Carlini PR c++/58600 * g++.dg/cpp0x/gen-attrs-58.C: New. * g++.dg/cpp0x/gen-attrs-59.C: Likewise. From-SVN: r209310 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 77473fef3b00..f722da300e62 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-04-11 Paolo Carlini + + PR c++/58600 + * name-lookup.c (parse_using_directive): Return early if the + attribs argument is error_mark_node; use get_attribute_name. + 2014-04-11 Jason Merrill DR 1030 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 0137c3f4a337..8ad0d06f283c 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4019,13 +4019,14 @@ do_using_directive (tree name_space) void parse_using_directive (tree name_space, tree attribs) { - tree a; - do_using_directive (name_space); - for (a = attribs; a; a = TREE_CHAIN (a)) + if (attribs == error_mark_node) + return; + + for (tree a = attribs; a; a = TREE_CHAIN (a)) { - tree name = TREE_PURPOSE (a); + tree name = get_attribute_name (a); if (is_attribute_p ("strong", name)) { if (!toplevel_bindings_p ()) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0675d469f945..fdacc9ce3f4a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-04-11 Paolo Carlini + + PR c++/58600 + * g++.dg/cpp0x/gen-attrs-58.C: New. + * g++.dg/cpp0x/gen-attrs-59.C: Likewise. + 2014-04-11 Steve Ellcey Jakub Jelinek diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-58.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-58.C new file mode 100644 index 000000000000..f760f5608285 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-58.C @@ -0,0 +1,5 @@ +// PR c++/58600 +// { dg-do compile { target c++11 } } + +namespace N { int i; } +using namespace N alignas(int); // { dg-warning "ignored" } diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-59.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-59.C new file mode 100644 index 000000000000..c7839fefed91 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-59.C @@ -0,0 +1,5 @@ +// PR c++/58600 +// { dg-do compile { target c++11 } } + +namespace N {} +using namespace N alignas(X); // { dg-error "declared" }