re PR c++/69113 (ICE: in vague_linkage_p, at cp/decl2.c:1875 with -fno-weak)

PR c++/69113
	* decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.

	* g++.dg/pr69113.C: New test.

From-SVN: r232189
This commit is contained in:
Marek Polacek 2016-01-09 11:15:26 +00:00 committed by Marek Polacek
parent 20b8d7342c
commit 73f0dae2a4
4 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2016-01-09 Marek Polacek <polacek@redhat.com>
PR c++/69113
* decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
2016-01-09 Jakub Jelinek <jakub@redhat.com>
PR c++/69164

View File

@ -1820,7 +1820,8 @@ comdat_linkage (tree decl)
}
}
DECL_COMDAT (decl) = 1;
if (TREE_PUBLIC (decl))
DECL_COMDAT (decl) = 1;
}
/* For win32 we also want to put explicit instantiations in

View File

@ -1,3 +1,8 @@
2016-01-09 Marek Polacek <polacek@redhat.com>
PR c++/69113
* g++.dg/pr69113.C: New test.
2016-01-09 Jakub Jelinek <jakub@redhat.com>
PR middle-end/50865

View File

@ -0,0 +1,17 @@
// PR c++/69113
// { dg-do compile }
// { dg-options "-fno-weak" }
struct foo
{
static void bar ()
{
struct baz
{
static void m ()
{
static int n;
}
};
}
};