Search code examples
clang-tidy

What is the meaning of the 'AnalyzeTemporaryDtors' option in clang-tidy?


The clang-tidy --dump-config command produces something like this:

---
Checks:          'clang-diagnostic-*,clang-analyzer-*'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle:     none
User:            [...]
CheckOptions:
  - key:             [...]
    value:           [...]
[...]

What is the meaning of the AnalyzeTemporaryDtors option? What does it change when it is set to true? All the other options are documented, but I could not find any documentation related to this one, and I could not find any difference changing the value of the option.


Solution

  • AnalyzeTemporaryDtors is an artifact from an older clang-tidy version, notably 6 and below.

    The corresponding option -analyze-temporary-dtors= was removed, but since a lot of people do -dump-config (which dumps every option), removing AnalyzeTemporaryDtors apparently broke a lot of projects with such generated .clang-tidy, so it was added back for compatibility purposes: https://reviews.llvm.org/rG6e76a1b1ff98b27b82689b6294cde1d355be088f.

    Feel free to remove it from your .clang-tidy.