[PATCH] D156728: [Sema] Ignore nullability qualifiers when deducing types for `auto` and `__auto_type`

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 31 12:57:03 PDT 2023


gribozavr2 added a comment.

I understand that this is an expedient fix that silences the warning. However, the fundamental problem is the simplistic implementation of the warning (that it is not flow-sensitive), not the inference of nullability. That is, when we are removing nullability qualifiers, we don't know whether there was a check or not. So while this change removes some false positives, it also removes some true positives.



================
Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:3933
       //   type are ignored for type deduction.
+      // Ignore top level nullability qualifiers too.
       ArgType = ArgType.getUnqualifiedType();
----------------
This comment merely duplicates the code. Please add an explanation why it is done.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156728/new/

https://reviews.llvm.org/D156728



More information about the cfe-commits mailing list