Skip to content

Commit fbc9ebb

Browse files
committed
[Clang] Remove __is_nullptr
1 parent 7e2b5e2 commit fbc9ebb

File tree

5 files changed

+2
-47
lines changed

5 files changed

+2
-47
lines changed

clang/docs/LanguageExtensions.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,10 +1614,6 @@ The following type trait primitives are supported by Clang. Those traits marked
16141614
* ``__is_nothrow_assignable`` (C++, MSVC 2013)
16151615
* ``__is_nothrow_constructible`` (C++, MSVC 2013)
16161616
* ``__is_nothrow_destructible`` (C++, MSVC 2013)
1617-
* ``__is_nullptr`` (C++, GNU, Microsoft, Embarcadero):
1618-
Returns true for ``std::nullptr_t`` and false for everything else. The
1619-
corresponding standard library feature is ``std::is_null_pointer``, but
1620-
``__is_null_pointer`` is already in use by some implementations.
16211617
* ``__is_object`` (C++, Embarcadero)
16221618
* ``__is_pod`` (C++, GNU, Microsoft, Embarcadero):
16231619
Note, the corresponding standard trait was deprecated in C++20.

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,9 @@ Decl *Parser::ParseLinkage(ParsingDeclSpec &DS, DeclaratorContext Context) {
447447
///
448448
/// HLSL: Parse export function declaration.
449449
///
450-
/// export-function-declaration:
450+
/// export-function-declaration:
451451
/// 'export' function-declaration
452-
///
452+
///
453453
/// export-declaration-group:
454454
/// 'export' '{' function-declaration-seq[opt] '}'
455455
///
@@ -1799,7 +1799,6 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
17991799
tok::kw___is_nothrow_constructible,
18001800
tok::kw___is_nothrow_convertible,
18011801
tok::kw___is_nothrow_destructible,
1802-
tok::kw___is_nullptr,
18031802
tok::kw___is_object,
18041803
tok::kw___is_pod,
18051804
tok::kw___is_pointer,

clang/lib/Parse/ParseExpr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ bool Parser::isRevertibleTypeTrait(const IdentifierInfo *II,
800800
REVERTIBLE_TYPE_TRAIT(__is_nothrow_assignable);
801801
REVERTIBLE_TYPE_TRAIT(__is_nothrow_constructible);
802802
REVERTIBLE_TYPE_TRAIT(__is_nothrow_destructible);
803-
REVERTIBLE_TYPE_TRAIT(__is_nullptr);
804803
REVERTIBLE_TYPE_TRAIT(__is_object);
805804
REVERTIBLE_TYPE_TRAIT(__is_pod);
806805
REVERTIBLE_TYPE_TRAIT(__is_pointer);

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4979,7 +4979,6 @@ static bool CheckUnaryTypeTraitTypeCompleteness(Sema &S, TypeTrait UTT,
49794979
case UTT_IsArray:
49804980
case UTT_IsBoundedArray:
49814981
case UTT_IsPointer:
4982-
case UTT_IsNullPointer:
49834982
case UTT_IsReferenceable:
49844983
case UTT_IsLvalueReference:
49854984
case UTT_IsRvalueReference:
@@ -5235,8 +5234,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT,
52355234
return T->isIncompleteArrayType();
52365235
case UTT_IsPointer:
52375236
return T->isAnyPointerType();
5238-
case UTT_IsNullPointer:
5239-
return T->isNullPtrType();
52405237
case UTT_IsLvalueReference:
52415238
return T->isLValueReferenceType();
52425239
case UTT_IsRvalueReference:

clang/test/SemaCXX/type-traits.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,42 +1041,6 @@ void is_pointer()
10411041
static_assert(!__is_pointer(void (StructWithMembers::*) ()));
10421042
}
10431043

1044-
void is_null_pointer() {
1045-
StructWithMembers x;
1046-
1047-
static_assert(__is_nullptr(decltype(nullptr)));
1048-
static_assert(!__is_nullptr(void *));
1049-
static_assert(!__is_nullptr(cvoid *));
1050-
static_assert(!__is_nullptr(cvoid *));
1051-
static_assert(!__is_nullptr(char *));
1052-
static_assert(!__is_nullptr(int *));
1053-
static_assert(!__is_nullptr(int **));
1054-
static_assert(!__is_nullptr(ClassType *));
1055-
static_assert(!__is_nullptr(Derives *));
1056-
static_assert(!__is_nullptr(Enum *));
1057-
static_assert(!__is_nullptr(IntArNB *));
1058-
static_assert(!__is_nullptr(Union *));
1059-
static_assert(!__is_nullptr(UnionAr *));
1060-
static_assert(!__is_nullptr(StructWithMembers *));
1061-
static_assert(!__is_nullptr(void (*)()));
1062-
1063-
static_assert(!__is_nullptr(void));
1064-
static_assert(!__is_nullptr(cvoid));
1065-
static_assert(!__is_nullptr(cvoid));
1066-
static_assert(!__is_nullptr(char));
1067-
static_assert(!__is_nullptr(int));
1068-
static_assert(!__is_nullptr(int));
1069-
static_assert(!__is_nullptr(ClassType));
1070-
static_assert(!__is_nullptr(Derives));
1071-
static_assert(!__is_nullptr(Enum));
1072-
static_assert(!__is_nullptr(IntArNB));
1073-
static_assert(!__is_nullptr(Union));
1074-
static_assert(!__is_nullptr(UnionAr));
1075-
static_assert(!__is_nullptr(StructWithMembers));
1076-
static_assert(!__is_nullptr(int StructWithMembers::*));
1077-
static_assert(!__is_nullptr(void(StructWithMembers::*)()));
1078-
}
1079-
10801044
void is_member_object_pointer()
10811045
{
10821046
StructWithMembers x;

0 commit comments

Comments
 (0)