[PATCH] D66572: [analyzer] NFC: BugReporter Separation Ep.I.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 13:40:01 PDT 2019


NoQ marked 5 inline comments as done.
NoQ added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:113
+  // encouraged, but the period at the end of the description is still omitted.
+  StringRef getDescription() const { return Description; }
+
----------------
gribozavr wrote:
> Thanks for the doc comments! Please use three slashes here and in getShortDescription.
Whoops.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:131
+
+  /// The smallest canonical declaration that contains the bug location.
+  /// This is purely cosmetic; the declaration can be presented to the user
----------------
gribozavr wrote:
> Thanks for the explanation, just one question -- I don't understand what is meant by "canonical".
> 
> The bug can be found in a non-canonical declaration.
> 
> ```
> void f(); // canonical decl
> 
> void f() { // non-canonical decl
>   *(int*)0 = 0; // bug
> }
> ```
Ugh, i somehow keep thinking that the definition, if available, will always be the `getCanonicalDecl()`, even though i stepped into this a few times already >.<

That's why we have bugs like D57619.


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

https://reviews.llvm.org/D66572





More information about the cfe-commits mailing list