]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/33911 (attribute deprecated vs. templates)
authorEaswaran Raman <eraman@google.com>
Thu, 3 Oct 2013 17:39:35 +0000 (17:39 +0000)
committerEaswaran Raman <eraman@gcc.gnu.org>
Thu, 3 Oct 2013 17:39:35 +0000 (17:39 +0000)
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

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/attrib47.C [new file with mode: 0644]

index 0769847be94d0b66f34e79bb81350b55eb910637..cd75094273182ca3d74cd9aae0473f0204fb8154 100644 (file)
@@ -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
index d0a23f3c3b84ed9227939e8b70050eef351198b1..42b4e60219ee2527d6c43b7f59c7849e9c30f441 100644 (file)
@@ -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);
     }
index 6e4a4e473219235946e8078cd5be38e89aa0d26b..b423b92620a382f699495729882eb3648a577021 100644 (file)
@@ -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 (file)
index 0000000..22f4908
--- /dev/null
@@ -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_" } }