Commit bbe04f21 by Jason Merrill Committed by Jason Merrill

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
parent ca10595c
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> 2012-01-22 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/51924 PR rtl-optimization/51924
......
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> 2012-01-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/ext-elim-1.c: New test. * gcc.dg/ext-elim-1.c: New test.
......
template<class...T> struct A
{
static int i;
};
inline void f() { A<int>::i = 0; }
// PR c++/51832
// { dg-lto-do link }
// { dg-lto-options { "-std=c++11 -flto -fabi-version=2" } }
#include "pr51832.h"
int main() { }
...@@ -484,6 +484,7 @@ varpool_analyze_pending_decls (void) ...@@ -484,6 +484,7 @@ varpool_analyze_pending_decls (void)
{ {
DECL_WEAK (node->decl) = DECL_WEAK (node->alias_of); DECL_WEAK (node->decl) = DECL_WEAK (node->alias_of);
TREE_PUBLIC (node->decl) = TREE_PUBLIC (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); DECL_VISIBILITY (node->decl) = DECL_VISIBILITY (node->alias_of);
if (TREE_PUBLIC (node->decl)) if (TREE_PUBLIC (node->decl))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment