From: Easwaran Raman Date: Thu, 3 Oct 2013 17:39:35 +0000 (+0000) Subject: re PR c++/33911 (attribute deprecated vs. templates) X-Git-Tag: releases/gcc-4.9.0~3718 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1f11e2bae47de8b47ed5e6b530111cce5434960;p=thirdparty%2Fgcc.git re PR c++/33911 (attribute deprecated vs. templates) 2013-10-03 Easwaran Raman PR c++/33911 * parser.c (cp_parser_init_declarator): Do not drop attributes of template member functions. 2013-10-03 Easwaran Raman PR c++/33911 * g++.dg/ext/attribute47.C: New. From-SVN: r203174 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0769847be94d..cd7509427318 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-10-03 Easwaran Raman + + PR c++/33911 + * parser.c (cp_parser_init_declarator): Do not drop attributes + of template member functions. + 2013-10-03 Marek Polacek PR c++/58510 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index d0a23f3c3b84..42b4e60219ee 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16548,7 +16548,7 @@ cp_parser_init_declarator (cp_parser* parser, decl = grokfield (declarator, decl_specifiers, initializer, !is_non_constant_init, /*asmspec=*/NULL_TREE, - prefix_attributes); + chainon (attributes, prefix_attributes)); if (decl && TREE_CODE (decl) == FUNCTION_DECL) cp_parser_save_default_args (parser, decl); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6e4a4e473219..b423b92620a3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-10-03 Easwaran Raman + + PR c++/33911 + * g++.dg/ext/attribute47.C: New. + 2013-10-03 Marek Polacek PR c++/58510 diff --git a/gcc/testsuite/g++.dg/ext/attrib47.C b/gcc/testsuite/g++.dg/ext/attrib47.C new file mode 100644 index 000000000000..22f49084bcc6 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attrib47.C @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "-O2" } + +class A +{ + public: + template + T foo(T a) __attribute__ ((noinline)); +}; + +template + T A::foo(T a) + { + return a+1; + } + +int bar(A a) { + return a.foo(1); +} + +// { dg-final { scan-assembler "_ZN1A3fooIiEET_S1_" } }