diff options
author | John McCall <rjmccall@apple.com> | 2010-11-13 01:35:44 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-13 01:35:44 +0000 |
commit | e84af4e4867cadf9edbd1120edf6999e42673cdd (patch) | |
tree | d6819709606fa0dc0c791231ea057430c39f32cd /clang/lib/Sema/SemaCXXCast.cpp | |
parent | 1aa5863a3e679e6dcd5dde7531569275e174b7ed (diff) | |
download | bcm5719-llvm-e84af4e4867cadf9edbd1120edf6999e42673cdd.tar.gz bcm5719-llvm-e84af4e4867cadf9edbd1120edf6999e42673cdd.zip |
Introduce a null-to-pointer implicit cast kind.
llvm-svn: 118966
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCXXCast.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp index 25ad7b6a87c..baeebe1e409 100644 --- a/clang/lib/Sema/SemaCXXCast.cpp +++ b/clang/lib/Sema/SemaCXXCast.cpp @@ -1131,7 +1131,7 @@ static TryCastResult TryReinterpretCast(Sema &Self, Expr *SrcExpr, // Is the source an overloaded name? (i.e. &foo) // If so, reinterpret_cast can not help us here (13.4, p1, bullet 5) - if (SrcType == Self.Context.OverloadTy ) + if (SrcType == Self.Context.OverloadTy) return TC_NotApplicable; if (const ReferenceType *DestTypeTmp = DestType->getAs<ReferenceType>()) { @@ -1270,6 +1270,8 @@ static TryCastResult TryReinterpretCast(Sema &Self, Expr *SrcExpr, assert(destIsPtr && "One type must be a pointer"); // C++ 5.2.10p5: A value of integral or enumeration type can be explicitly // converted to a pointer. + // C++ 5.2.10p9: [Note: ...a null pointer constant of integral type is not + // necessarily converted to a null pointer value.] Kind = CK_IntegralToPointer; return TC_Success; } |