Commit 4217ff2d authored by Bill Wendling's avatar Bill Wendling
Browse files

Approved by Chris:

$ svn merge -c 113124 https://llvm.org/svn/llvm-project/cfe/trunk
--- Merging r113124 into '.':
A    test/SemaCXX/unary-real-imag.cpp
U    lib/Sema/SemaExpr.cpp

Log:
PR8023: Don't crash on invalid uses of __real__ on class types in C++.

$ svn merge -c 113125 https://llvm.org/svn/llvm-project/cfe/trunk
--- Merging r113125 into '.':
U    lib/Lex/Pragma.cpp

Log:
fix 7320: we can't delete a trailing space if it doesn't exist.

$ svn merge -c 113127 https://llvm.org/svn/llvm-project/cfe/trunk
--- Merging r113127 into '.':
U    test/Sema/warn-write-strings.c
U    lib/Headers/stddef.h

Log:
fix PR7192 by defining wchar_t in a more conventional way.  The
type of L"x" can change based on command line arguments.

$ svn merge -c 113128 https://llvm.org/svn/llvm-project/cfe/trunk
--- Merging r113128 into '.':
A    test/CodeGen/fold-const-declref.c
U    lib/AST/ExprConstant.cpp

Log:
PR7242: Make sure to use a different context for evaluating constant
initializers, so the result of the evaluation doesn't leak through
inconsistently.  Also, don't evaluate references to variables with
initializers with side-effects.

$ svn merge -c 113130 https://llvm.org/svn/llvm-project/cfe/trunk
--- Merging r113130 into '.':
U    test/CodeGen/designated-initializers.c
U    lib/CodeGen/CGExprAgg.cpp

Log:
move the hackaround for PR6537 to catch unions as well,
fixing the ICE in PR7151

$ svn merge -c 113131 https://llvm.org/svn/llvm-project/cfe/trunk
--- Merging r113131 into '.':
U    test/SemaCXX/i-c-e-cxx.cpp

Log:
Update test for r113128.

llvm-svn: 113151
parent 2b291257
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1008,8 +1008,11 @@ bool IntExprEvaluator::CheckReferencedDecl(const Expr* E, const Decl* D) {

        VD->setEvaluatingValue();

        if (Visit(const_cast<Expr*>(Init))) {
        Expr::EvalResult EResult;
        if (Init->Evaluate(EResult, Info.Ctx) && !EResult.HasSideEffects &&
            EResult.Val.isInt()) {
          // Cache the evaluated value in the variable declaration.
          Result = EResult.Val;
          VD->setEvaluatedValue(Result);
          return true;
        }
+12 −12
Original line number Diff line number Diff line
@@ -582,7 +582,16 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
  // the optimizer, especially with bitfields.
  unsigned NumInitElements = E->getNumInits();
  RecordDecl *SD = E->getType()->getAs<RecordType>()->getDecl();
  unsigned CurInitVal = 0;
  
  // If we're initializing the whole aggregate, just do it in place.
  // FIXME: This is a hack around an AST bug (PR6537).
  if (NumInitElements == 1 && E->getType() == E->getInit(0)->getType()) {
    EmitInitializationToLValue(E->getInit(0),
                               CGF.MakeAddrLValue(DestPtr, E->getType()),
                               E->getType());
    return;
  }
  
  
  if (E->getType()->isUnionType()) {
    // Only initialize one field of a union. The field itself is
@@ -616,18 +625,9 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
    return;
  }

  // If we're initializing the whole aggregate, just do it in place.
  // FIXME: This is a hack around an AST bug (PR6537).
  if (NumInitElements == 1 && E->getType() == E->getInit(0)->getType()) {
    EmitInitializationToLValue(E->getInit(0),
                               CGF.MakeAddrLValue(DestPtr, E->getType()),
                               E->getType());
    return;
  }
  

  // Here we iterate over the fields; this makes it simpler to both
  // default-initialize fields and skip over unnamed fields.
  unsigned CurInitVal = 0;
  for (RecordDecl::field_iterator Field = SD->field_begin(),
                               FieldEnd = SD->field_end();
       Field != FieldEnd; ++Field) {
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ typedef __typeof__(sizeof(int)) size_t;
#ifndef __cplusplus
#ifndef _WCHAR_T
#define _WCHAR_T
typedef __typeof__(*L"") wchar_t;
typedef __WCHAR_TYPE__ wchar_t;
#endif
#endif

+3 −1
Original line number Diff line number Diff line
@@ -384,6 +384,8 @@ void Preprocessor::HandlePragmaDependency(Token &DependencyTok) {
      Lex(DependencyTok);
    }

    // Remove the trailing ' ' if present.
    if (!Message.empty())
      Message.erase(Message.end()-1);
    Diag(FilenameTok, diag::pp_out_of_date_dependency) << Message;
  }
+1 −1
Original line number Diff line number Diff line
@@ -6796,7 +6796,7 @@ ExprResult Sema::BuildUnaryOp(Scope *S, SourceLocation OpLoc,
                              UnaryOperatorKind Opc,
                              Expr *Input) {
  if (getLangOptions().CPlusPlus && Input->getType()->isOverloadableType() &&
      Opc != UO_Extension) {
      UnaryOperator::getOverloadedOperator(Opc) != OO_None) {
    // Find all of the overloaded operators visible from this
    // point. We perform both an operator-name lookup from the local
    // scope and an argument-dependent lookup based on the types of
Loading