summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-static-var.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-01-26 19:04:10 +0000
committerBen Langmuir <blangmuir@apple.com>2015-01-26 19:04:10 +0000
commit577b39349e20a5ca39bd4aa04793aa1bdfd6216a (patch)
tree18139a9c032db8fd2896c843617384e801bda988 /clang/test/SemaTemplate/instantiate-static-var.cpp
parent611dfed99fc60ce6eb9542b78e80dc8398eb9828 (diff)
downloadbcm5719-llvm-577b39349e20a5ca39bd4aa04793aa1bdfd6216a.tar.gz
bcm5719-llvm-577b39349e20a5ca39bd4aa04793aa1bdfd6216a.zip
Fix assert instantiating string init of static variable
... when the variable's type is a typedef of a ConstantArrayType. Just look through the typedef (and any other sugar). We only use the constant array type here to get the element count. llvm-svn: 227115
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-static-var.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-static-var.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-static-var.cpp b/clang/test/SemaTemplate/instantiate-static-var.cpp
index f309f29eafa..a7b3433b354 100644
--- a/clang/test/SemaTemplate/instantiate-static-var.cpp
+++ b/clang/test/SemaTemplate/instantiate-static-var.cpp
@@ -114,3 +114,15 @@ namespace PR6449 {
template class X1<char>;
}
+
+typedef char MyString[100];
+template <typename T>
+struct StaticVarWithTypedefString {
+ static MyString str;
+};
+template <typename T>
+MyString StaticVarWithTypedefString<T>::str = "";
+
+void testStaticVarWithTypedefString() {
+ (void)StaticVarWithTypedefString<int>::str;
+}
OpenPOWER on IntegriCloud