From: Zoe Carver Date: Mon, 23 Sep 2019 16:02:46 +0000 (+0000) Subject: Fix __is_fundamental to accept nullptr_t X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b460ada78b12b9d38511a4305b4a04886e8884a;p=clang Fix __is_fundamental to accept nullptr_t 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 --- diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 88f022b083..fcc74198ab 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -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()); diff --git a/test/SemaCXX/type-traits.cpp b/test/SemaCXX/type-traits.cpp index e190844533..99270f19e6 100644 --- a/test/SemaCXX/type-traits.cpp +++ b/test/SemaCXX/type-traits.cpp @@ -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))];