aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/Expr.h4
-rw-r--r--lib/AST/Expr.cpp3
-rw-r--r--lib/Sema/SemaExpr.cpp4
3 files changed, 5 insertions, 6 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index 2ed9112475..43da7a16b6 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -467,9 +467,9 @@ class FloatingLiteral : public Expr {
bool IsExact : 1;
SourceLocation Loc;
public:
- FloatingLiteral(const llvm::APFloat &V, bool* isexact,
+ FloatingLiteral(const llvm::APFloat &V, bool isexact,
QualType Type, SourceLocation L)
- : Expr(FloatingLiteralClass, Type), Value(V), IsExact(*isexact), Loc(L) {}
+ : Expr(FloatingLiteralClass, Type), Value(V), IsExact(isexact), Loc(L) {}
/// \brief Construct an empty floating-point literal.
explicit FloatingLiteral(EmptyShell Empty)
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index fce88cc0da..4d90c7a956 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -41,8 +41,7 @@ CharacterLiteral* CharacterLiteral::Clone(ASTContext &C) const {
}
FloatingLiteral* FloatingLiteral::Clone(ASTContext &C) const {
- bool exact = IsExact;
- return new (C) FloatingLiteral(Value, &exact, getType(), Loc);
+ return new (C) FloatingLiteral(Value, IsExact, getType(), Loc);
}
ImaginaryLiteral* ImaginaryLiteral::Clone(ASTContext &C) const {
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index fe284f73b0..4be49a0b4a 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1310,8 +1310,8 @@ Action::OwningExprResult Sema::ActOnNumericConstant(const Token &Tok) {
// isExact will be set by GetFloatValue().
bool isExact = false;
- Res = new (Context) FloatingLiteral(Literal.GetFloatValue(Format, &isExact),
- &isExact, Ty, Tok.getLocation());
+ llvm::APFloat Val = Literal.GetFloatValue(Format, &isExact);
+ Res = new (Context) FloatingLiteral(Val, isExact, Ty, Tok.getLocation());
} else if (!Literal.isIntegerLiteral()) {
return ExprError();