[Bug c++/84294] attributes on a function template redeclaration silently discarded

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 2 00:17:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84294

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Fri Mar  2 00:16:52 2018
New Revision: 258121

URL: https://gcc.gnu.org/viewcvs?rev=258121&root=gcc&view=rev
Log:
PR c++/84294 - attributes on a function template redeclaration silently
discarded

gcc/cp/ChangeLog:

        PR c++/84294
        * decl.c (check_redeclaration_no_default_args): Merge attributes
        specified on redeclarations of the same function template.
        Remove dead code.

gcc/testsuite/ChangeLog:

        PR c++/84294
        * g++.dg/ext/attr-const.C: Remove xfail.
        * g++.dg/ext/attr-malloc-3.C: New test.
        * g++.dg/ext/attr-noinline-3.C: New test.
        * g++.dg/ext/attr-noreturn-3.C: New test.
        * g++.dg/ext/attr-nothrow-3.C: New test.
        * g++.dg/ext/attr-pure.C: Remove xfail.


Added:
    trunk/gcc/testsuite/g++.dg/ext/attr-noinline-3.C
    trunk/gcc/testsuite/g++.dg/ext/attr-noreturn-3.C
    trunk/gcc/testsuite/g++.dg/ext/attr-nothrow-3.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/attr-const.C
    trunk/gcc/testsuite/g++.dg/ext/attr-malloc-3.C
    trunk/gcc/testsuite/g++.dg/ext/attr-pure.C


More information about the Gcc-bugs mailing list