aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2013-10-03 17:39:35 +0000
committerEaswaran Raman <eraman@gcc.gnu.org>2013-10-03 17:39:35 +0000
commitd1f11e2bae47de8b47ed5e6b530111cce5434960 (patch)
tree8d9616377119edc81fa55d927125a0dd6087861d
parent6867e128b97f35f1a20e58cbbf9b6030940b88de (diff)
downloadgcc-d1f11e2bae47de8b47ed5e6b530111cce5434960.zip
gcc-d1f11e2bae47de8b47ed5e6b530111cce5434960.tar.gz
gcc-d1f11e2bae47de8b47ed5e6b530111cce5434960.tar.bz2
re PR c++/33911 (attribute deprecated vs. templates)
2013-10-03 Easwaran Raman <eraman@google.com> PR c++/33911 * parser.c (cp_parser_init_declarator): Do not drop attributes of template member functions. 2013-10-03 Easwaran Raman <eraman@google.com> PR c++/33911 * g++.dg/ext/attribute47.C: New. From-SVN: r203174
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib47.C21
4 files changed, 33 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0769847..cd75094 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-03 Easwaran Raman <eraman@google.com>
+
+ PR c++/33911
+ * parser.c (cp_parser_init_declarator): Do not drop attributes
+ of template member functions.
+
2013-10-03 Marek Polacek <polacek@redhat.com>
PR c++/58510
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d0a23f3..42b4e60 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 6e4a4e4..b423b92 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-03 Easwaran Raman <eraman@google.com>
+
+ PR c++/33911
+ * g++.dg/ext/attribute47.C: New.
+
2013-10-03 Marek Polacek <polacek@redhat.com>
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 0000000..22f4908
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib47.C
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-O2" }
+
+class A
+{
+ public:
+ template <class T>
+ T foo(T a) __attribute__ ((noinline));
+};
+
+template <class T>
+ T A::foo(T a)
+ {
+ return a+1;
+ }
+
+int bar(A a) {
+ return a.foo(1);
+}
+
+// { dg-final { scan-assembler "_ZN1A3fooIiEET_S1_" } }