bool canBePointerOrReferenceQualifier() const {
return isOneOf(tok::kw_const, tok::kw_restrict, tok::kw_volatile,
tok::kw___attribute, tok::kw__Nonnull, tok::kw__Nullable,
- tok::kw__Null_unspecified);
+ tok::kw__Null_unspecified, tok::kw___ptr32, tok::kw___ptr64);
}
/// Determine whether the token is a simple-type-specifier.
verifyFormat("vector<a *_Nonnull> v;");
verifyFormat("vector<a *_Nullable> v;");
verifyFormat("vector<a *_Null_unspecified> v;");
+ verifyFormat("vector<a *__ptr32> v;");
+ verifyFormat("vector<a *__ptr64> v;");
verifyFormat("vector<a * _NotAQualifier> v;");
verifyFormat("vector<a * b> v;");
verifyFormat("foo<b && false>();");
verifyIndependentOfContext("MACRO(A *__attribute((foo)) a);");
verifyIndependentOfContext("MACRO(A *[[clang::attr]] a);");
verifyIndependentOfContext("MACRO(A *[[clang::attr(\"foo\")]] a);");
+ verifyIndependentOfContext("MACRO(A *__ptr32 a);");
+ verifyIndependentOfContext("MACRO(A *__ptr64 a);");
verifyIndependentOfContext("MACRO('0' <= c && c <= '9');");
verifyFormat("void f() { f(float{1}, a * a); }");
// FIXME: Is there a way to make this work?
verifyFormat("x = (foo *_Nonnull)*v;");
verifyFormat("x = (foo *[[clang::attr]])*v;");
verifyFormat("x = (foo *[[clang::attr(\"foo\")]])*v;");
+ verifyFormat("x = (foo *__ptr32)*v;");
+ verifyFormat("x = (foo *__ptr64)*v;");
// Check that we handle multiple trailing qualifiers and skip them all to
// determine that the expression is a cast to a pointer type.
LongPointerLeft.PointerAlignment = FormatStyle::PAS_Left;
StringRef AllQualifiers =
"const volatile restrict __attribute__((foo)) _Nonnull _Null_unspecified "
- "_Nonnull [[clang::attr]]";
+ "_Nonnull [[clang::attr]] __ptr32 __ptr64";
verifyFormat(("x = (foo *" + AllQualifiers + ")*v;").str(), LongPointerRight);
verifyFormat(("x = (foo* " + AllQualifiers + ")*v;").str(), LongPointerLeft);