I think what you're looking for is: if (DECL_CLONED_FUNCTION_P (clone) && DECL_CLONED_FUNCTION (clone) == decl)
That's a much cleaner implementation. Ollie On Tue, Sep 27, 2011 at 6:18 PM, Delesley Hutchins <deles...@google.com> wrote: > > This patch fixes a bug in the parser which cause an internal compiler > error when copying attributes from cloned methods. The bug occurs > when a class has both an annotated constructor and a template method. > > Bootstrapped and passed gcc regression testsuite on > x86_64-unknown-linux-gnu. Okay for google/gcc-4_6? > > -DeLesley > > cp/Changelog.google-4_6: > 2011-9-27 DeLesley Hutchins <deles...@google.com> > > * cp/parser.c (cp_parser_late_parsing_attribute_arg_lists) > fixed case where the potential clone is a template. > > testsuite/Changelog.google-4_6: > 2011-9-27 DeLesley Hutchins <deles...@google.com> > > * testsuite/g++.dg/thread-ann/thread_annot_lock-81.C > (new regression test) > > -- > DeLesley Hutchins | Software Engineer | deles...@google.com | 505-206-0315