Ignore parens when determining if an expr is a string literal. Fixes PR3382.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62922 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index e766ca0..0fb939e 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1031,7 +1031,7 @@
StringLiteral *Sema::IsStringLiteralInit(Expr *Init, QualType DeclType) {
const ArrayType *AT = Context.getAsArrayType(DeclType);
if (AT && AT->getElementType()->isCharType()) {
- return dyn_cast<StringLiteral>(Init);
+ return dyn_cast<StringLiteral>(Init->IgnoreParens());
}
return 0;
}