re PR c++/51832 (Rev.182970 causes LTO link errors (multiple definitions of allocator_traits))

PR c++/51832
	* varpool.c (varpool_analyze_pending_decls): Copy DECL_EXTERNAL
	for extra name aliases.

From-SVN: r183396
This commit is contained in:
Jason Merrill 2012-01-22 15:56:34 -05:00 committed by Jason Merrill
parent ca10595cf4
commit bbe04f213d
6 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2012-01-22 Jason Merrill <jason@redhat.com>
PR c++/51832
* varpool.c (varpool_analyze_pending_decls): Copy DECL_EXTERNAL
for extra name aliases.
2012-01-22 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/51924

View File

@ -1,3 +1,10 @@
2012-01-22 Jason Merrill <jason@redhat.com>
PR c++/51832
* g++.dg/lto/pr51832.h: New.
* g++.dg/lto/pr51832_0.C: New.
* g++.dg/lto/pr51832_1.C: New.
2012-01-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/ext-elim-1.c: New test.

View File

@ -0,0 +1,6 @@
template<class...T> struct A
{
static int i;
};
inline void f() { A<int>::i = 0; }

View File

@ -0,0 +1,7 @@
// PR c++/51832
// { dg-lto-do link }
// { dg-lto-options { "-std=c++11 -flto -fabi-version=2" } }
#include "pr51832.h"
int main() { }

View File

@ -0,0 +1 @@
#include "pr51832.h"

View File

@ -484,6 +484,7 @@ varpool_analyze_pending_decls (void)
{
DECL_WEAK (node->decl) = DECL_WEAK (node->alias_of);
TREE_PUBLIC (node->decl) = TREE_PUBLIC (node->alias_of);
DECL_EXTERNAL (node->decl) = DECL_EXTERNAL (node->alias_of);
DECL_VISIBILITY (node->decl) = DECL_VISIBILITY (node->alias_of);
if (TREE_PUBLIC (node->decl))
{