]> granicus.if.org Git - clang/commitdiff
The constant folder's diagnosic mechanism is irrelevant for C; don't bother
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 7 Mar 2012 00:30:44 +0000 (00:30 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 7 Mar 2012 00:30:44 +0000 (00:30 +0000)
producing a C-only diagnostic.

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

lib/AST/ExprConstant.cpp

index 1b15cb1d68d12a23019682767b622969cf8e23db..08794f355f73341767efc0f0807bb1e6aca40d47 100644 (file)
@@ -1691,10 +1691,6 @@ static bool AreElementsOfSameArray(QualType ObjType,
 static bool HandleLValueToRValueConversion(EvalInfo &Info, const Expr *Conv,
                                            QualType Type,
                                            const LValue &LVal, APValue &RVal) {
-  // In C, an lvalue-to-rvalue conversion is never a constant expression.
-  if (!Info.getLangOpts().CPlusPlus)
-    Info.CCEDiag(Conv->getExprLoc(), diag::note_invalid_subexpr_in_const_expr);
-
   if (LVal.Designator.Invalid)
     // A diagnostic will have already been produced.
     return false;