]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/60353 (Firefox build failure #3 caused by r208157)
authorJason Merrill <jason@redhat.com>
Thu, 27 Feb 2014 16:20:59 +0000 (11:20 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 27 Feb 2014 16:20:59 +0000 (11:20 -0500)
PR c++/60353
PR c++/55877
* decl2.c (tentative_decl_linkage): Don't mess with functions that
are not yet defined.

From-SVN: r208200

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/testsuite/g++.dg/other/anon6.C [new file with mode: 0644]

index 1f35d2a5909aa1c52f793d97a9a5cdf1ed876be4..de06bad305233e1604a7d3750daa8dff0eee6407 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-27  Jason Merrill  <jason@redhat.com>
+
+       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  <jason@redhat.com>
 
        PR c++/60347
index 1afe16ee949e862c0c8c52ff35188897eccc25d9..dfc532d5b0eff36ea79dfdf69ed278ab28a746c0 100644 (file)
@@ -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 (file)
index 0000000..2fd0942
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/60353
+
+struct A {
+  A(int);
+};
+typedef struct {
+  A format;
+} B;