[PATCH] D22794: [Sema] Propagate nullability when deducing type of auto

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 25 18:59:37 PDT 2016


ahatanak created this revision.
ahatanak added a reviewer: doug.gregor.
ahatanak added a subscriber: cfe-commits.

This patch fixes Sema to propagate the nullability of the initializer expression of a variable declared with auto or __auto_type to the deduced type. The patch consists of two parts:

- Define function QualType::setNullability, which is used to return a QualType with the specified nullability, and use it in computeConditionalNullability.
- Propagate nullability when type of auto is being deduced.

rdar://problem/27062504

https://reviews.llvm.org/D22794

Files:
  include/clang/AST/Type.h
  lib/AST/Type.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaExpr.cpp
  test/Sema/nullability.c
  test/SemaCXX/nullability.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22794.65460.patch
Type: text/x-patch
Size: 4152 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160726/537430aa/attachment-0001.bin>


More information about the cfe-commits mailing list