diff options
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 19ab835707b..6bafdf278d8 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -44,6 +44,16 @@ FloatingLiteral* FloatingLiteral::Clone(ASTContext &C) const {    return new (C) FloatingLiteral(Value, &exact, getType(), Loc);  } +ImaginaryLiteral* ImaginaryLiteral::Clone(ASTContext &C) const { +  // FIXME: Use virtual Clone(), once it is available +  Expr *ClonedVal = 0; +  if (const IntegerLiteral *IntLit = dyn_cast<IntegerLiteral>(Val)) +    ClonedVal = IntLit->Clone(C); +  else +    ClonedVal = cast<FloatingLiteral>(Val)->Clone(C); +  return new (C) ImaginaryLiteral(ClonedVal, getType()); +} +  GNUNullExpr* GNUNullExpr::Clone(ASTContext &C) const {    return new (C) GNUNullExpr(getType(), TokenLoc);  } | 

