[PATCH] D31673: Allow casting C pointers declared using extern "C" to ObjC pointer types
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 4 13:18:06 PDT 2017
rjmccall added inline comments.
================
Comment at: lib/Sema/SemaExprObjC.cpp:3358
var &&
- var->getStorageClass() == SC_Extern &&
+ !var->isThisDeclarationADefinition() &&
var->getType().isConstQualified()) {
----------------
Hmm. Come to think of it, I wonder if we actually care whether the variable has a definition, given that it's const.
Well, we can consider that later. I agree that this change is good.
================
Comment at: test/SemaObjCXX/arc-bridged-cast.mm:59
+extern "C" const CFAnnotatedObjectRef r2;
+extern "C" const CFAnnotatedObjectRef r3 = 0;
+
----------------
These examples are a little unfortunate because these values are known to be null pointers.
https://reviews.llvm.org/D31673
More information about the cfe-commits
mailing list