]> granicus.if.org Git - clang/commit
CodeGen: Fix linkage of reference temporaries
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 28 Apr 2014 22:17:59 +0000 (22:17 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 28 Apr 2014 22:17:59 +0000 (22:17 +0000)
commitf5563f573675f1b0b30884185cc52e611e97bd6c
tree6c0d74c4d1ca31c07c2830b15b7b7f5d9d7503ea
parentec47c9130c83eabfa9460651da30eefeac297f62
CodeGen: Fix linkage of reference temporaries

Summary:
A reference temporary should inherit the linkage of the variable it
initializes.  Otherwise, we may hit cases where a reference temporary
wouldn't have the same value in all translation units.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3515

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207451 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/Basic/Linkage.h
lib/AST/ASTContext.cpp
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
lib/Sema/SemaDecl.cpp
test/CXX/temp/temp.spec/temp.explicit/p1-emit.cpp
test/CodeGenCXX/const-init-cxx11.cpp
test/CodeGenCXX/const-init-cxx1y.cpp
test/CodeGenCXX/cxx11-thread-local.cpp
test/CodeGenCXX/cxx1y-variable-template.cpp
test/CodeGenCXX/specialized-static-data-mem-init.cpp
test/CodeGenCXX/static-init-3.cpp
test/CodeGenCXX/template-instantiation.cpp
test/CodeGenCXX/vla.cpp