[Sema] Fix a crash when nonnull checking
authorMichael Liao <michael.hliao@gmail.com>
Fri, 29 Mar 2019 03:55:52 +0000 (03:55 +0000)
committerMichael Liao <michael.hliao@gmail.com>
Fri, 29 Mar 2019 03:55:52 +0000 (03:55 +0000)
commitce38992a307908a3b2b97950a3a2a356ab32410d
tree7be964708ca96744b13ee52046b7a30e785c8a29
parent5fddf091879e195d1f3ac83e8384ec1ff2882c23
[Sema] Fix a crash when nonnull checking

Summary:
- If a parameter is used, nonnull checking needs function prototype to
  retrieve the corresponding parameter's attributes. However, at the
  prototype substitution phase when a template is being instantiated,
  expression may be created and checked without a fully specialized
  prototype. Under such a scenario, skip nonnull checking on that
  argument.

Reviewers: rjmccall, tra, yaxunl

Subscribers: javed.absar, kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59900

llvm-svn: 357236
clang/lib/Sema/SemaChecking.cpp
clang/test/SemaCXX/pr30559.cpp [new file with mode: 0644]