<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 19, 2015, at 11:10 AM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com" class="">aaron@aaronballman.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Fri, Jun 19, 2015 at 1:51 PM, Douglas Gregor <</span><a href="mailto:dgregor@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">dgregor@apple.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Author: dgregor<br class="">Date: Fri Jun 19 12:51:05 2015<br class="">New Revision: 240146<br class=""><br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D240146-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=pdoEcJh00EYVBnvtSf8wOM9tvdRKSmyfkcvPmUt8iYY&s=oC_CNTxY51MqNaw-w3pO7PTpnt2OaWaaKvjUKdl9s9I&e=" class="">http://llvm.org/viewvc/llvm-project?rev=240146&view=rev</a><br class="">Log:<br class="">Introduce type nullability specifiers for C/C++.<br class=""><br class="">Introduces the type specifiers __nonnull, __nullable, and<br class="">__null_unspecified that describe the nullability of the pointer type<br class="">to which the specifier appertains. Nullability type specifiers improve<br class="">on the existing nonnull attributes in a few ways:<br class=""> - They apply to types, so one can represent a pointer to a non-null<br class="">   pointer, use them in function pointer types, etc.<br class=""> - As type specifiers, they are syntactically more lightweight than<br class="">   __attribute__s or [[attribute]]s.<br class=""> - They can express both the notion of 'should never be null' and<br class=""> also 'it makes sense for this to be null', and therefore can more<br class=""> easily catch errors of omission where one forgot to annotate the<br class=""> nullability of a particular pointer (this will come in a subsequent<br class=""> patch).<br class=""><br class="">Nullability type specifiers are maintained as type sugar, and<br class="">therefore have no effect on mangling, encoding, overloading,<br class="">etc. Nonetheless, they will be used for warnings about, e.g., passing<br class="">'null' to a method that does not accept it.<br class=""><br class="">This is the C/C++ part of <a href="rdar://problem/18868820" class="">rdar://problem/18868820</a>.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This is great stuff! I have some trivial comments below.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_include_clang_Basic_Attr.td-3Frev-3D240146-26r1-3D240145-26r2-3D240146-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=pdoEcJh00EYVBnvtSf8wOM9tvdRKSmyfkcvPmUt8iYY&s=J-MBLxMi-RuwKKTwZ05M9pbhxT20vutmY2ngEFL_Ib8&e=" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=240146&r1=240145&r2=240146&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/include/clang/Basic/Attr.td (original)<br class="">+++ cfe/trunk/include/clang/Basic/Attr.td Fri Jun 19 12:51:05 2015<br class="">@@ -960,6 +960,22 @@ def ReturnsNonNull : InheritableAttr {<br class="">  let Documentation = [Undocumented];<br class="">}<br class=""><br class="">+// Nullability type attributes.<br class="">+def TypeNonNull : TypeAttr {<br class="">+  let Spellings = [Keyword<"__nonnull">];<br class="">+  let Documentation = [Undocumented];<br class="">+}<br class="">+<br class="">+def TypeNullable : TypeAttr {<br class="">+  let Spellings = [Keyword<"__nullable">];<br class="">+  let Documentation = [Undocumented];<br class="">+}<br class="">+<br class="">+def TypeNullUnspecified : TypeAttr {<br class="">+  let Spellings = [Keyword<"__null_unspecified">];<br class="">+  let Documentation = [Undocumented];<br class="">+}<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Please add documentation for these type attributes (we frown on new</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">attributes that are flagged as Undocumented).</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Good call, r240296.</div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_include_clang_Basic_DiagnosticParseKinds.td-3Frev-3D240146-26r1-3D240145-26r2-3D240146-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=pdoEcJh00EYVBnvtSf8wOM9tvdRKSmyfkcvPmUt8iYY&s=li1R7QdGT0gg_-IkjyKdqmVFuACvknKLiiy4o-L9h6M&e=" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=240146&r1=240145&r2=240146&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)<br class="">+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Fri Jun 19 12:51:05 2015<br class="">@@ -65,6 +65,10 @@ def ext_keyword_as_ident : ExtWarn<<br class="">  "%select{here|for the remainder of the translation unit}1">,<br class="">  InGroup<KeywordCompat>;<br class=""><br class="">+def ext_nullability : Extension<<br class="">+  "type nullability specifier %0 is a Clang extension">,<br class="">+  InGroup<DiagGroup<"nullability-extension">>;<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Please have %0 quoted in the diagnostic.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div>It’s not necessary; we pass in an IdentifierInfo* here.</div><div><br class=""><blockquote type="cite" class=""><div class=""><br class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">Modified: cfe/trunk/lib/Parse/ParseDecl.cpp<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Parse_ParseDecl.cpp-3Frev-3D240146-26r1-3D240145-26r2-3D240146-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=pdoEcJh00EYVBnvtSf8wOM9tvdRKSmyfkcvPmUt8iYY&s=2TTRBkdwEvWw1WIK-qxjSIGZNA8YlPcke4x0dTV0Nmk&e=" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=240146&r1=240145&r2=240146&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)<br class="">+++ cfe/trunk/lib/Parse/ParseDecl.cpp Fri Jun 19 12:51:05 2015<br class="">@@ -687,6 +687,28 @@ void Parser::ParseOpenCLQualifiers(Parse<br class="">               AttributeList::AS_Keyword);<br class="">}<br class=""><br class="">+void Parser::ParseNullabilityTypeSpecifiers(ParsedAttributes &attrs) {<br class="">+  // Treat these like attributes, even though they're type specifiers.<br class="">+  while (true) {<br class="">+    switch (Tok.getKind()) {<br class="">+    case tok::kw___nonnull:<br class="">+    case tok::kw___nullable:<br class="">+    case tok::kw___null_unspecified: {<br class="">+      IdentifierInfo *AttrName = Tok.getIdentifierInfo();<br class="">+      SourceLocation AttrNameLoc = ConsumeToken();<br class="">+      if (!getLangOpts().ObjC1)<br class="">+        Diag(AttrNameLoc, diag::ext_nullability)<br class="">+          << AttrName;<br class="">+      attrs.addNew(AttrName, AttrNameLoc, nullptr, AttrNameLoc, nullptr, 0,<br class="">+                   AttributeList::AS_Keyword);<br class="">+      break;<br class="">+    }<br class="">+    default:<br class="">+      return;<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Would it be more clear to move the default to be the first label in</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">the switch, and have it break instead of return (in case we would like</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">to do post-processing of these at some point)?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Personally, I find it clearer the way it is.</div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">Modified: cfe/trunk/lib/Sema/SemaDecl.cpp<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Sema_SemaDecl.cpp-3Frev-3D240146-26r1-3D240145-26r2-3D240146-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=pdoEcJh00EYVBnvtSf8wOM9tvdRKSmyfkcvPmUt8iYY&s=ys_CrvwbmGDM1NqLLQ76HMX_9uoY-2MXI0D6-mXZtgs&e=" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=240146&r1=240145&r2=240146&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)<br class="">+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Jun 19 12:51:05 2015<br class="">@@ -2465,6 +2465,28 @@ static void mergeParamDeclAttributes(Par<br class="">  if (!foundAny) newDecl->dropAttrs();<br class="">}<br class=""><br class="">+static void mergeParamDeclTypes(ParmVarDecl *NewParam,<br class="">+                                const ParmVarDecl *OldParam,<br class="">+                                Sema &S) {<br class="">+  if (auto Oldnullability = OldParam->getType()->getNullability(S.Context)) {<br class="">+    if (auto Newnullability = NewParam->getType()->getNullability(S.Context)) {<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Can we put the dereference into the assignment expression, since these</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">are only ever used as dereferenced?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div>We cannot, because we’re getting an Optional<NullabilityKind> here, and we need to check whether we have a value.</div><div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+      if (*Oldnullability != *Newnullability) {<br class="">+        S.Diag(NewParam->getLocation(), diag::warn_mismatched_nullability_attr)<br class="">+          << static_cast<unsigned>(*Newnullability)<br class="">+          << static_cast<unsigned>(*Oldnullability);<br class="">+        S.Diag(OldParam->getLocation(), diag::note_previous_declaration);<br class="">+      }<br class="">+    }<br class="">+    else {<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Formatting.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div>Okay.</div><div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+/// Distribute a nullability type attribute that cannot be applied to<br class="">+/// the type specifier to a pointer, block pointer, or member pointer<br class="">+/// declarator, complaining if necessary.<br class="">+///<br class="">+/// \returns true if the nullability annotation was distributed, false<br class="">+/// otherwise.<br class="">+static bool distributeNullabilityTypeAttr(TypeProcessingState &state,<br class="">+                                          QualType type,<br class="">+                                          AttributeList &attr) {<br class="">+  Declarator &declarator = state.getDeclarator();<br class="">+<br class="">+  /// Attempt to move the attribute to the specified chunk.<br class="">+  auto moveToChunk = [&](DeclaratorChunk &chunk, bool inFunction) -> bool {<br class="">+    // If there is already a nullability attribute there, don't add<br class="">+    // one.<br class="">+    if (hasNullabilityAttr(chunk.getAttrListRef()))<br class="">+      return false;<br class="">+<br class="">+    // Complain about the nullability qualifier being in the wrong<br class="">+    // place.<br class="">+    unsigned pointerKind<br class="">+      = chunk.Kind == DeclaratorChunk::Pointer ? (inFunction ? 3 : 0)<br class="">+        : chunk.Kind == DeclaratorChunk::BlockPointer ? 1<br class="">+        : inFunction? 4 : 2;<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Can we replace the magic numbers with something else?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div>Sure, we can give these meaningful names.</div><div><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>- Doug</div><div class=""><br class=""></div></body></html>