diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-06-25 00:15:56 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-06-25 00:15:56 +0000 |
commit | 62f19e700d3126415bb443162501eefe22cf1811 (patch) | |
tree | f099beb58ddd384abd71e64128ae992e87362263 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | b8da3a2bb2b840db6ab7c473190ee6d65dcf3a1e (diff) | |
download | llvm-62f19e700d3126415bb443162501eefe22cf1811.zip llvm-62f19e700d3126415bb443162501eefe22cf1811.tar.gz llvm-62f19e700d3126415bb443162501eefe22cf1811.tar.bz2 |
Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives a
variable weak discardable linkage and partially-ordered initialization, and is
implied for constexpr static data members.)
llvm-svn: 273754
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 02858b3..ac00bf8 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3746,6 +3746,12 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { case Decl::Namespace: EmitNamespace(cast<NamespaceDecl>(D)); break; + case Decl::CXXRecord: + // Emit any static data members, they may be definitions. + for (auto *I : cast<CXXRecordDecl>(D)->decls()) + if (isa<VarDecl>(I) || isa<CXXRecordDecl>(I)) + EmitTopLevelDecl(I); + break; // No code generation needed. case Decl::UsingShadow: case Decl::ClassTemplate: |