]> granicus.if.org Git - clang/commitdiff
Fix __is_fundamental to accept nullptr_t
authorZoe Carver <z.zoelec2@gmail.com>
Mon, 23 Sep 2019 16:02:46 +0000 (16:02 +0000)
committerZoe Carver <z.zoelec2@gmail.com>
Mon, 23 Sep 2019 16:02:46 +0000 (16:02 +0000)
    Summary: This patch updates the __is_fundamental builtin type trait to return true for nullptr_t.

    Reviewers: rsmith, EricWF, efriedma, craig.topper, erichkeane

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D67899

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372624 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Type.h
test/SemaCXX/type-traits.cpp

index 88f022b083cfffebea6ddb5de37c8a5c087d0fc2..fcc74198ab0be3316dd9e382c533f00fb868f86d 100644 (file)
@@ -6353,6 +6353,7 @@ inline bool QualType::isCForbiddenLValueType() const {
 /// \returns True for types specified in C++0x [basic.fundamental].
 inline bool Type::isFundamentalType() const {
   return isVoidType() ||
+         isNullPtrType() ||
          // FIXME: It's really annoying that we don't have an
          // 'isArithmeticType()' which agrees with the standard definition.
          (isArithmeticType() && !isEnumeralType());
index e190844533138c96d7d42ab8642c326c80f65149..99270f19e68b1efaed8ca9a738325bb50e20253e 100644 (file)
@@ -802,6 +802,7 @@ void is_fundamental()
   int t23[T(__is_fundamental(unsigned long))];
   int t24[T(__is_fundamental(void))];
   int t25[T(__is_fundamental(cvoid))];
+  int t26[T(__is_fundamental(decltype(nullptr)))];
 
   int t30[F(__is_fundamental(Union))];
   int t31[F(__is_fundamental(UnionAr))];