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
This commit is contained in:
parent
6867e128b9
commit
d1f11e2bae
4 changed files with 33 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
21
gcc/testsuite/g++.dg/ext/attrib47.C
Normal file
21
gcc/testsuite/g++.dg/ext/attrib47.C
Normal file
|
@ -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_" } }
|
Loading…
Add table
Reference in a new issue