From: Eli Friedman Date: Mon, 15 Dec 2008 22:34:21 +0000 (+0000) Subject: Fix for PR3212: don't descend into C++ operator overloading code for C X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03f332a8f4300bbaa91240f461923e7874892dd3;p=clang Fix for PR3212: don't descend into C++ operator overloading code for C programs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61056 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 98afb0f701..affe2ae240 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -963,10 +963,10 @@ ActOnArraySubscriptExpr(Scope *S, ExprTy *Base, SourceLocation LLoc, Expr *LHSExp = static_cast(Base), *RHSExp = static_cast(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;