summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-01-10 23:08:26 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-01-10 23:08:26 +0000
commit93ee9caaede478563bed7d29c7331552f74c3508 (patch)
treeea07994ab16660e05e49fd5a99767fcda36fd7ee /clang/test/CodeGenCXX/cxx1z-inline-variables.cpp
parent1f74a24ac05ce493a46bdadec4d7c089398214b5 (diff)
downloadbcm5719-llvm-93ee9caaede478563bed7d29c7331552f74c3508.tar.gz
bcm5719-llvm-93ee9caaede478563bed7d29c7331552f74c3508.zip
In C++17, when instantiating an out-of-line definition of an inline static data
member, don't forget to instantiate the initializer too. llvm-svn: 322236
Diffstat (limited to 'clang/test/CodeGenCXX/cxx1z-inline-variables.cpp')
-rw-r--r--clang/test/CodeGenCXX/cxx1z-inline-variables.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp b/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp
index 2d16acd8a8c..50eab3b7061 100644
--- a/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp
+++ b/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp
@@ -58,14 +58,22 @@ template<typename T> struct X {
static int a;
static inline int b;
static int c;
+ static const int d;
+ static int e;
};
// CHECK: @_ZN1XIiE1aE = linkonce_odr global i32 10
// CHECK: @_ZN1XIiE1bE = global i32 20
// CHECK-NOT: @_ZN1XIiE1cE
+// CHECK: @_ZN1XIiE1dE = linkonce_odr constant i32 40
+// CHECK: @_ZN1XIiE1eE = linkonce_odr global i32 50
template<> inline int X<int>::a = 10;
int &use3 = X<int>::a;
template<> int X<int>::b = 20;
template<> inline int X<int>::c = 30;
+template<typename T> constexpr int X<T>::d = 40;
+template<typename T> inline int X<T>::e = 50;
+const int *use_x_int_d = &X<int>::d;
+const int *use_x_int_e = &X<int>::e;
template<typename T> struct Y;
template<> struct Y<int> {
OpenPOWER on IntegriCloud