summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-12-15 10:00:35 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-12-15 10:00:35 +0000
commit69e6d608610f9a6d8841dbcf2cacae543ee7a25d (patch)
tree76f2b53596956264db645225962355e764dae231 /lib/Sema/SemaExpr.cpp
parenta478cbc1f8716ccf953df8509e0d0bb2593765be (diff)
Sema: Don't diagnose string + int if the int is value dependent
Don't send a value dependent expression into the expression evaluator, HandleSizeof would crash. Making HandleSizeof handle dependent types would noisily warn about the operation even if everything turns out OK after instantiation. This fixes PR21848. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index c04b99d464..876e5b71e0 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -7282,7 +7282,7 @@ static void diagnoseStringPlusInt(Sema &Self, SourceLocation OpLoc,
bool IsStringPlusInt = StrExpr &&
IndexExpr->getType()->isIntegralOrUnscopedEnumerationType();
- if (!IsStringPlusInt)
+ if (!IsStringPlusInt || IndexExpr->isValueDependent())
return;
llvm::APSInt index;