From 577b39349e20a5ca39bd4aa04793aa1bdfd6216a Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Mon, 26 Jan 2015 19:04:10 +0000 Subject: 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 --- clang/test/SemaTemplate/instantiate-static-var.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/test/SemaTemplate/instantiate-static-var.cpp') 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; } + +typedef char MyString[100]; +template +struct StaticVarWithTypedefString { + static MyString str; +}; +template +MyString StaticVarWithTypedefString::str = ""; + +void testStaticVarWithTypedefString() { + (void)StaticVarWithTypedefString::str; +} -- cgit v1.2.3