[cfe-commits] r113091 - in /cfe/trunk: lib/AST/TypePrinter.cpp test/Misc/diag-aka-types.cpp test/Sema/varargs-x86-64.c test/SemaCXX/reinterpret-cast.cpp

Chris Lattner sabre at nondot.org
Sat Sep 4 17:07:29 PDT 2010


Author: lattner
Date: Sat Sep  4 19:07:29 2010
New Revision: 113091

URL: http://llvm.org/viewvc/llvm-project?rev=113091&view=rev
Log:
print "const intptr_t" instead of "intptr_t const"

Modified:
    cfe/trunk/lib/AST/TypePrinter.cpp
    cfe/trunk/test/Misc/diag-aka-types.cpp
    cfe/trunk/test/Sema/varargs-x86-64.c
    cfe/trunk/test/SemaCXX/reinterpret-cast.cpp

Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=113091&r1=113090&r2=113091&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Sat Sep  4 19:07:29 2010
@@ -72,7 +72,8 @@
   // the type is complex.  For example if the type is "int*", we *must* print
   // "int * const", printing "const int *" is different.  Only do this when the
   // type expands to a simple string.
-  bool CanPrefixQualifiers = isa<BuiltinType>(T);
+  bool CanPrefixQualifiers =
+    isa<BuiltinType>(T) || isa<TypedefType>(T);
   
   if (!CanPrefixQualifiers && !Quals.empty()) {
     std::string TQS;

Modified: cfe/trunk/test/Misc/diag-aka-types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/diag-aka-types.cpp?rev=113091&r1=113090&r2=113091&view=diff
==============================================================================
--- cfe/trunk/test/Misc/diag-aka-types.cpp (original)
+++ cfe/trunk/test/Misc/diag-aka-types.cpp Sat Sep  4 19:07:29 2010
@@ -7,4 +7,4 @@
 char c1 = ptr; // expected-error{{'foo_t *' (aka 'X *')}}
 
 const foo_t &ref = foo_t();
-char c2 = ref; // expected-error{{'foo_t const' (aka 'X const')}}
+char c2 = ref; // expected-error{{'const foo_t' (aka 'X const')}}

Modified: cfe/trunk/test/Sema/varargs-x86-64.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/varargs-x86-64.c?rev=113091&r1=113090&r2=113091&view=diff
==============================================================================
--- cfe/trunk/test/Sema/varargs-x86-64.c (original)
+++ cfe/trunk/test/Sema/varargs-x86-64.c Sat Sep  4 19:07:29 2010
@@ -3,6 +3,6 @@
 // rdar://6726818
 void f1() {
   const __builtin_va_list args2;
-  (void)__builtin_va_arg(args2, int); // expected-error {{first argument to 'va_arg' is of type '__builtin_va_list const' and not 'va_list'}}
+  (void)__builtin_va_arg(args2, int); // expected-error {{first argument to 'va_arg' is of type 'const __builtin_va_list' and not 'va_list'}}
 }
 

Modified: cfe/trunk/test/SemaCXX/reinterpret-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/reinterpret-cast.cpp?rev=113091&r1=113090&r2=113091&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/reinterpret-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/reinterpret-cast.cpp Sat Sep  4 19:07:29 2010
@@ -105,6 +105,6 @@
   const STRING *s;
   const char *c;
 
-  (void)reinterpret_cast<char *>(s); // expected-error {{reinterpret_cast from 'STRING const *' (aka 'char const (*)[10]') to 'char *' casts away constness}}
+  (void)reinterpret_cast<char *>(s); // expected-error {{reinterpret_cast from 'const STRING *' (aka 'char const (*)[10]') to 'char *' casts away constness}}
   (void)reinterpret_cast<const STRING *>(c);
 }





More information about the cfe-commits mailing list