[all-commits] [llvm/llvm-project] 318677: [Sema] Avoid Wrange-loop-analysis false positives

mordante via All-commits all-commits at lists.llvm.org
Thu Jan 23 11:05:49 PST 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 318677e78def0023d210a29f4b3cf648e02f9fdc
      https://github.com/llvm/llvm-project/commit/318677e78def0023d210a29f4b3cf648e02f9fdc
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2020-01-23 (Thu, 23 Jan 2020)

  Changed paths:
    M clang/lib/Sema/SemaStmt.cpp
    M clang/test/SemaCXX/warn-range-loop-analysis.cpp

  Log Message:
  -----------
  [Sema] Avoid Wrange-loop-analysis false positives

When Wrange-loop-analysis issues a diagnostic on a dependent type in a
template the diagnostic may not be valid for all instantiations. Therefore
the diagnostic is suppressed during the instantiation. Non dependent types
still issue a diagnostic.

The same can happen when using macros. Therefore the diagnostic is
disabled for macros.

Fixes https://bugs.llvm.org/show_bug.cgi?id=44556

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

(cherry picked from commit 41fcd17250fa0526e4b7fd2c7df7721b0f79b683)




More information about the All-commits mailing list