[cfe-commits] r156826 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaChecking.cpp test/Analysis/array-struct-region.c test/CXX/expr/expr.unary/expr.unary.op/p6.cpp test/CXX/temp/temp.spec/p5.cpp test/PCH/exprs.h test/Sema/array-init.c test/Sema/knr-def-call.c test/SemaCXX/bool.cpp test/SemaCXX/conversion.cpp test/SemaCXX/expressions.cpp test/SemaCXX/overload-call.cpp test/SemaCXX/warn-literal-conversion.cpp test/SemaTemplate/member-template-access-expr.cpp

Jordan Rose jediknil at belkadan.com
Tue May 15 10:06:16 PDT 2012


On May 15, 2012, at 12:56, David Blaikie wrote:

> +  SmallString<16> PrettySourceValue;
> +  Value.toString(PrettySourceValue);
> +  std::string PrettyTargetValue;
> +  if (T->isSpecificBuiltinType(BuiltinType::Bool))
> +    PrettyTargetValue = IntegerValue == 0 ? "false" : "true";
> +  else
> +    PrettyTargetValue = IntegerValue.toString(10);
> +

Why the std::string for the target?

SmallString<16> PrettyTargetValue;
if (T->isSpecificBuiltinType(BuiltinType::Bool))
  PrettyTargetValue = (IntegerValue == 0) ? "false" : "true";
else
  IntegerValue.toString(PrettyTargetValue);

(The base defaults to 10 for this version of toString.)

Jordy



More information about the cfe-commits mailing list