rsmith added a comment.

This generally makes sense to me. `_Nonnull` in this position seems very 
similar to `static` (which typically also implies non-nullness).



================
Comment at: lib/CodeGen/CGDebugInfo.cpp:2493-2499
   case Type::Adjusted:
-  case Type::Decayed:
+  case Type::Decayed: {
     // Decayed and adjusted types use the adjusted type in LLVM and DWARF.
-    return CreateType(
-        cast<PointerType>(cast<AdjustedType>(Ty)->getAdjustedType()), Unit);
+    QualType Adjusted = cast<AdjustedType>(Ty)->getAdjustedType();
+    (void)AttributedType::stripOuterNullability(Adjusted);
+    return CreateType(cast<PointerType>(Adjusted), Unit);
+  }
----------------
I think this should be handled by `UnwrapTypeForDebugInfo` instead of here; 
this is after all just a type sugar node.


================
Comment at: lib/Sema/SemaType.cpp:6659
               attr.isContextSensitiveKeywordAttribute(),
+              state.getDeclarator().isPrototypeContext(),
               /*implicit=*/false)) {
----------------
I'm not sure this is enough; you should make sure you also reject

  void f(int [5][_Nonnull 1]) {}

and the like.


Repository:
  rL LLVM

https://reviews.llvm.org/D25850



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to