Reikriam

clang suffix diff

May 2nd, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
  2. index 0d2e54d8d9a..538a342d93a 100644
  3. --- a/clang/lib/AST/TemplateBase.cpp
  4. +++ b/clang/lib/AST/TemplateBase.cpp
  5. @@ -76,13 +76,18 @@ static void printIntegral(const TemplateArgument &TemplArg,
  6. Out.write_escaped(StringRef(&Ch, 1), /*UseHexEscapes=*/ true);
  7. Out << "'";
  8. } else {
  9. - Out << Val;
  10. if (T->isBuiltinType()) {
  11. - if (Val.isUnsigned())
  12. - Out << "U";
  13. - if (Val.getBitWidth() == 64)
  14. - Out << "LL";
  15. + if (T->isUnsignedIntegerType() && Val.getBitWidth() == 64)
  16. + Out << Val << "ULL";
  17. + else if (T->isSignedIntegerType() && Val.getBitWidth() == 64)
  18. + Out << Val << "LL";
  19. + else if (T->isUnsignedIntegerType())
  20. + Out << Val << "U";
  21. + else
  22. + Out << "(" << T->getCanonicalTypeInternal().getAsString(Policy) << ")" << Val;
  23. }
  24. + else
  25. + Out << Val;
  26. }
  27. }
Add Comment
Please, Sign In to add comment