diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-02 02:48:42 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-02 02:48:42 +0000 |
commit | 435e647a4145239fbbf77b09a8f1b4d8bf4cd47e (patch) | |
tree | 5a8c87bf719506ce6a773c86b098f4d93dfa2803 /clang/test/CodeGenCXX/cxx1y-variable-template.cpp | |
parent | a8c5d3af60e61614c1b5a4c8e203c85ada9203e9 (diff) | |
download | bcm5719-llvm-435e647a4145239fbbf77b09a8f1b4d8bf4cd47e.tar.gz bcm5719-llvm-435e647a4145239fbbf77b09a8f1b4d8bf4cd47e.zip |
PR35456: Track definedness of variable template specializations separately from
whether they have an initializer.
We cannot distinguish between a declaration of a variable template
specialization and a definition of one that lacks an initializer without this,
and would previously mistake the latter for the former.
llvm-svn: 319605
Diffstat (limited to 'clang/test/CodeGenCXX/cxx1y-variable-template.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/cxx1y-variable-template.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/cxx1y-variable-template.cpp b/clang/test/CodeGenCXX/cxx1y-variable-template.cpp index cd73817d850..dd8f28e4299 100644 --- a/clang/test/CodeGenCXX/cxx1y-variable-template.cpp +++ b/clang/test/CodeGenCXX/cxx1y-variable-template.cpp @@ -18,6 +18,12 @@ int init_arr(); template<typename T> template<typename U> template<typename V> int Outer<T>::Inner<U>::arr[sizeof(T) + sizeof(U) + sizeof(V)] = { init_arr() }; int *p = Outer<char[100]>::Inner<char[20]>::arr<char[3]>; +namespace PR35456 { +// CHECK: @_ZN7PR354561nILi0EEE = linkonce_odr global i32 0 +template<int> int n; +int *p = &n<0>; +} + // CHECK: @_ZN5OuterIA100_cE5InnerIA20_cE3arrIA3_cEE = linkonce_odr global [123 x i32] zeroinitializer // CHECK: @_ZGVN5OuterIA100_cE5InnerIA20_cE3arrIA3_cEE = linkonce_odr global |