]> granicus.if.org Git - clang/commitdiff
Fix for PR3212: don't descend into C++ operator overloading code for C
authorEli Friedman <eli.friedman@gmail.com>
Mon, 15 Dec 2008 22:34:21 +0000 (22:34 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Mon, 15 Dec 2008 22:34:21 +0000 (22:34 +0000)
programs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61056 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 98afb0f701d052ddb7fc5257535b3f646b2e0015..affe2ae2403a3c4eaf2115e33989cc32ccca2162 100644 (file)
@@ -963,10 +963,10 @@ ActOnArraySubscriptExpr(Scope *S, ExprTy *Base, SourceLocation LLoc,
   Expr *LHSExp = static_cast<Expr*>(Base), *RHSExp = static_cast<Expr*>(Idx);
 
   if (getLangOptions().CPlusPlus &&
-      LHSExp->getType()->isRecordType() || 
-      LHSExp->getType()->isEnumeralType() ||
-      RHSExp->getType()->isRecordType() ||
-      RHSExp->getType()->isEnumeralType()) {
+      (LHSExp->getType()->isRecordType() || 
+       LHSExp->getType()->isEnumeralType() ||
+       RHSExp->getType()->isRecordType() ||
+       RHSExp->getType()->isEnumeralType())) {
     // Add the appropriate overloaded operators (C++ [over.match.oper]) 
     // to the candidate set.
     OverloadCandidateSet CandidateSet;