Backmerged from trunk PR c++/51344

Backmerged from trunk
        PR c++/51344
        * decl2.c (save_template_attributes): Use merge_attributes
        instead of chaining up via TREE_CHAIN.

        * g++.dg/torture/pr51344.C: New test.

From-SVN: r183319
This commit is contained in:
Kai Tietz 2012-01-20 00:07:01 +01:00 committed by Kai Tietz
parent 4657b24337
commit af765cc21b
4 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2012-01-19 Kai Tietz <ktietz@redhat.com>
PR c++/51344
* decl2.c (save_template_attributes): Use merge_attributes
instead of chaining up via TREE_CHAIN.
2011-10-19 Jason Merrill <jason@redhat.com>
PR c++/50793

View File

@ -1152,9 +1152,9 @@ save_template_attributes (tree *attr_p, tree *decl_p)
old_attrs = *q;
/* Place the late attributes at the beginning of the attribute
/* Merge the late attributes at the beginning with the attribute
list. */
TREE_CHAIN (tree_last (late_attrs)) = *q;
late_attrs = merge_attributes (late_attrs, *q);
*q = late_attrs;
if (!DECL_P (*decl_p) && *decl_p == TYPE_MAIN_VARIANT (*decl_p))

View File

@ -1,3 +1,7 @@
2012-01-19 Kai Tietz <ktietz@redhat.com>
* g++.dg/torture/pr51344.C: New test.
2012-01-15 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/51821

View File

@ -0,0 +1,9 @@
/* { dg-do compile } */
template <class T>
class B
{
friend __attribute__((cdecl)) A& operator >>(A& a, B& b)
{
return a;
}
};