[cfe-dev] PrettyPrinting statements with type signed/unsigned char

Andrey Tarasevich tarasevich.andrey at gmail.com
Fri Jun 7 06:39:28 PDT 2013


Hello,

When I'm trying to pretty print statement with type signed or unsigned char I'm getting an error from the StmtPrinter - "Unexpected type for integer literal!". Is this a bug? If yes, then following small patch fixes it. At least in my case it works just fine and statements are printed correctly.

Cheers,
Andrey Tarasevich

--- StmtPrinter.cpp 2013-06-07 15:17:31.000000000 +0200
+++ StmtPrinter.cpp   2013-06-07 15:24:43.000000000 +0200
@@ -731,6 +731,8 @@
   // FIXME: The Short and UShort cases are to handle cases where a short
   // integeral literal is formed during template instantiation.  They should
   // be removed when template instantiation no longer needs integer literals.
+  case BuiltinType::UChar:
+  case BuiltinType::SChar:
   case BuiltinType::Short:
   case BuiltinType::UShort:
   case BuiltinType::Int:       break; // no suffix.



More information about the cfe-dev mailing list