From 72e839ca6ba1a268d1bc840e7c35b674e9731309 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 24 Jun 2015 09:21:45 +0000 Subject: [PATCH] re PR c++/65811 (ice in vague_linkage_p) /cp 2015-06-24 Paolo Carlini PR c++/65811 * decl.c (duplicate_decls): Adjust DECL_COMDAT of newdecl. /testsuite 2015-06-24 Paolo Carlini PR c++/65811 * g++.dg/other/linkage2.C: New. From-SVN: r224888 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/other/linkage2.C | 10 ++++++++++ 4 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/other/linkage2.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index de6e856e420..03f09895052 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-06-24 Paolo Carlini + + PR c++/65811 + * decl.c (duplicate_decls): Adjust DECL_COMDAT of newdecl. + 2015-06-23 Patrick Palka PR c++/30044 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a8fc1a57a95..8f0bb34c4b6 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2106,6 +2106,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) TREE_STATIC (olddecl) = TREE_STATIC (newdecl) |= TREE_STATIC (olddecl); if (! DECL_EXTERNAL (olddecl)) DECL_EXTERNAL (newdecl) = 0; + if (! DECL_COMDAT (olddecl)) + DECL_COMDAT (newdecl) = 0; new_template_info = NULL_TREE; if (DECL_LANG_SPECIFIC (newdecl) && DECL_LANG_SPECIFIC (olddecl)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index daadf4c4229..7786e48e8e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-06-24 Paolo Carlini + + PR c++/65811 + * g++.dg/other/linkage2.C: New. + 2015-06-24 Ramana Radhakrishnan PR target/63408 diff --git a/gcc/testsuite/g++.dg/other/linkage2.C b/gcc/testsuite/g++.dg/other/linkage2.C new file mode 100644 index 00000000000..97f8ef2fcaa --- /dev/null +++ b/gcc/testsuite/g++.dg/other/linkage2.C @@ -0,0 +1,10 @@ +// PR c++/65811 + +struct foo { int i; }; + +static void fn1 (); +inline void +fn1 () +{ + static struct foo a[1]; +} -- 2.30.2