From: Jason Merrill Date: Thu, 27 Feb 2014 16:20:59 +0000 (-0500) Subject: re PR c++/60353 (Firefox build failure #3 caused by r208157) X-Git-Tag: releases/gcc-4.9.0~643 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fce82f5899d4a5a46e52f355518c5bd7bfa4435;p=thirdparty%2Fgcc.git re PR c++/60353 (Firefox build failure #3 caused by r208157) PR c++/60353 PR c++/55877 * decl2.c (tentative_decl_linkage): Don't mess with functions that are not yet defined. From-SVN: r208200 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1f35d2a5909a..de06bad30523 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2014-02-27 Jason Merrill + + PR c++/60353 + PR c++/55877 + * decl2.c (tentative_decl_linkage): Don't mess with functions that + are not yet defined. + 2014-02-26 Jason Merrill PR c++/60347 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 1afe16ee949e..dfc532d5b0ef 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2564,7 +2564,8 @@ tentative_decl_linkage (tree decl) be handled. */; else if (vague_linkage_p (decl)) { - if (TREE_CODE (decl) == FUNCTION_DECL) + if (TREE_CODE (decl) == FUNCTION_DECL + && decl_defined_p (decl)) { DECL_EXTERNAL (decl) = 1; DECL_NOT_REALLY_EXTERN (decl) = 1; @@ -2586,11 +2587,8 @@ tentative_decl_linkage (tree decl) DECL_INTERFACE_KNOWN (decl) = 1; } } - else - { - gcc_assert (TREE_CODE (decl) == VAR_DECL); - maybe_commonize_var (decl); - } + else if (TREE_CODE (decl) == VAR_DECL) + maybe_commonize_var (decl); } } diff --git a/gcc/testsuite/g++.dg/other/anon6.C b/gcc/testsuite/g++.dg/other/anon6.C new file mode 100644 index 000000000000..2fd094254a6d --- /dev/null +++ b/gcc/testsuite/g++.dg/other/anon6.C @@ -0,0 +1,8 @@ +// PR c++/60353 + +struct A { + A(int); +}; +typedef struct { + A format; +} B;