diff options
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | lib/Sema/SemaExpr.cpp | 33 | 
1 files changed, 12 insertions, 21 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 0d0f2f5b99a4f..d2e0e6b63b4df 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -9438,10 +9438,11 @@ ExprResult Sema::VerifyIntegerConstantExpression(Expr *E,        PDiag(diag::err_expr_not_ice) << LangOpts.CPlusPlus);  } -ExprResult Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, -                                                 PartialDiagnostic NotIceDiag, -                                                 bool AllowFold, -                                                 PartialDiagnostic FoldDiag) { +ExprResult +Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, +                                      const PartialDiagnostic &NotIceDiag, +                                      bool AllowFold, +                                      const PartialDiagnostic &FoldDiag) {    SourceLocation DiagLoc = E->getLocStart();    if (getLangOpts().CPlusPlus0x) { @@ -9773,6 +9774,12 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func) {    // FIXME: Is this really right?    if (CurContext == Func) return; +  // Instantiate the exception specification for any function which is +  // used: CodeGen will need it. +  const FunctionProtoType *FPT = Func->getType()->getAs<FunctionProtoType>(); +  if (FPT && FPT->getExceptionSpecType() == EST_Uninstantiated) +    InstantiateExceptionSpec(Loc, Func); +    // Implicit instantiation of function templates and member functions of    // class templates.    if (Func->isImplicitlyInstantiable()) { @@ -11268,22 +11275,6 @@ ExprResult  Sema::ActOnObjCBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind) {    assert((Kind == tok::kw___objc_yes || Kind == tok::kw___objc_no) &&           "Unknown Objective-C Boolean value!"); -  QualType ObjCBoolLiteralQT = Context.ObjCBuiltinBoolTy; -  // signed char is the default type for boolean literals. Use 'BOOL' -  // instead, if BOOL typedef is visible in its scope instead. -  Decl *TD =  -    LookupSingleName(TUScope, &Context.Idents.get("BOOL"),  -                     SourceLocation(), LookupOrdinaryName); -  if (TypedefDecl *BoolTD = dyn_cast_or_null<TypedefDecl>(TD)) { -    QualType QT = BoolTD->getUnderlyingType(); -    if (!QT->isIntegralOrUnscopedEnumerationType()) { -      Diag(OpLoc, diag::warn_bool_for_boolean_literal) << QT; -      Diag(BoolTD->getLocation(), diag::note_previous_declaration); -    } -    else -      ObjCBoolLiteralQT = QT; -  } -      return Owned(new (Context) ObjCBoolLiteralExpr(Kind == tok::kw___objc_yes, -                                        ObjCBoolLiteralQT, OpLoc)); +                                        Context.ObjCBuiltinBoolTy, OpLoc));  }  | 
