// 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;
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')}}
// 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'}}
}
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);
}