From ea53cedeb1eeb7e0db126d1cd0580d1482826cde Mon Sep 17 00:00:00 2001 From: guwirth Date: Mon, 19 Feb 2024 16:35:24 +0100 Subject: [PATCH] LLVM 19 support - use tag llvmorg-19-init - new ClangTidy rules: - bugprone-casting-through-void - bugprone-chained-comparison - bugprone-compare-pointer-to-member-virtual-function - bugprone-empty-catch - bugprone-inc-dec-in-conditions - bugprone-incorrect-enable-if - bugprone-multi-level-implicit-pointer-conversion - bugprone-multiple-new-in-one-expression - bugprone-non-zero-enum-to-bool-conversion - bugprone-optional-value-conversion - bugprone-switch-missing-default-case - bugprone-unique-ptr-array-mismatch - bugprone-unsafe-functions - bugprone-unused-local-non-trivial-variable - cert-msc24-c - cert-msc33-c - clang-analyzer-core.BitwiseShift - clang-analyzer-core.uninitialized.NewArraySize - clang-analyzer-cplusplus.PlacementNew - clang-analyzer-cplusplus.PureVirtualCall - clang-analyzer-cplusplus.StringChecker - clang-analyzer-fuchsia.HandleChecker - clang-analyzer-optin.core.EnumCastOutOfRange - clang-analyzer-security.cert.env.InvalidPtr - clang-analyzer-security.insecureAPI.decodeValueOfObjCType - clang-analyzer-unix.Errno - clang-analyzer-unix.StdCLibraryFunctions - clang-analyzer-webkit.NoUncountedMemberChecker - clang-analyzer-webkit.RefCntblBaseVirtualDtor - clang-analyzer-webkit.UncountedLambdaCapturesChecker - clang-diagnostic-android-unversioned-fallback - clang-diagnostic-apinotes - clang-diagnostic-array-parameter - clang-diagnostic-atomic-access - clang-diagnostic-auto-decl-extensions - clang-diagnostic-c++11-narrowing-const-reference - clang-diagnostic-c++23-default-comp-relaxed-constexpr - clang-diagnostic-c++23-extensions - clang-diagnostic-c++23-lambda-attributes - clang-diagnostic-c++26-extensions - clang-diagnostic-c++2c-extensions - clang-diagnostic-c23-compat - clang-diagnostic-c23-extensions - clang-diagnostic-c2x-compat - clang-diagnostic-cast-function-type-strict - clang-diagnostic-coro-non-aligned-allocation-function - clang-diagnostic-delayed-template-parsing-in-cxx20 - clang-diagnostic-deprecate-lax-vec-conv-all - clang-diagnostic-deprecated-builtins - clang-diagnostic-deprecated-literal-operator - clang-diagnostic-deprecated-module-dot-map - clang-diagnostic-deprecated-non-prototype - clang-diagnostic-deprecated-redundant-constexpr-static-def - clang-diagnostic-deprecated-static-analyzer-flag - clang-diagnostic-dxil-validation - clang-diagnostic-eager-load-cxx-named-modules - clang-diagnostic-enum-constexpr-conversion - clang-diagnostic-excessive-regsave - clang-diagnostic-experimental-header-units - clang-diagnostic-format-overflow - clang-diagnostic-format-overflow-non-kprintf - clang-diagnostic-format-truncation - clang-diagnostic-format-truncation-non-kprintf - clang-diagnostic-generic-type-extension - clang-diagnostic-gnu-line-marker - clang-diagnostic-gnu-null-pointer-arithmetic - clang-diagnostic-gnu-offsetof-extensions - clang-diagnostic-gnu-pointer-arith - clang-diagnostic-gnu-statement-expression-from-macro-expansion - clang-diagnostic-hip-omp-target-directives - clang-diagnostic-hlsl-extensions - clang-diagnostic-ignored-gch - clang-diagnostic-include-angled-in-module-purview - clang-diagnostic-incompatible-function-pointer-types-strict - clang-diagnostic-incompatible-ms-pragma-section - clang-diagnostic-invalid-feature-combination - clang-diagnostic-invalid-static-assert-message - clang-diagnostic-invalid-unevaluated-string - clang-diagnostic-invalid-utf8 - clang-diagnostic-knl-knm-isa-support-removed - clang-diagnostic-mathematical-notation-identifier-extension - clang-diagnostic-microsoft-init-from-predefined - clang-diagnostic-microsoft-string-literal-from-predefined - clang-diagnostic-misexpect - clang-diagnostic-missing-multilib - clang-diagnostic-module-include-translation - clang-diagnostic-multi-gpu - clang-diagnostic-nan-infinity-disabled - clang-diagnostic-nonportable-private-apinotes-path - clang-diagnostic-nonportable-private-system-apinotes-path - clang-diagnostic-objc-duplicate-category-definition - clang-diagnostic-openacc - clang-diagnostic-openmp-extensions - clang-diagnostic-openmp-target-exception - clang-diagnostic-overriding-option - clang-diagnostic-packed-non-pod - clang-diagnostic-padded-bitfield - clang-diagnostic-pre-c++23-compat - clang-diagnostic-pre-c++23-compat-pedantic - clang-diagnostic-pre-c++26-compat - clang-diagnostic-pre-c++26-compat-pedantic - clang-diagnostic-pre-c++2c-compat - clang-diagnostic-pre-c++2c-compat-pedantic - clang-diagnostic-pre-c23-compat - clang-diagnostic-pre-c23-compat-pedantic - clang-diagnostic-read-only-types - clang-diagnostic-reserved-module-identifier - clang-diagnostic-return-local-addr - clang-diagnostic-sarif-format-unstable - clang-diagnostic-single-bit-bitfield-constant-conversion - clang-diagnostic-sloc-usage - clang-diagnostic-source-uses-openacc - clang-diagnostic-switch-default - clang-diagnostic-sync-alignment - clang-diagnostic-tautological-negation-compare - clang-diagnostic-thread-safety-reference-return - clang-diagnostic-unaligned-qualifier-implicit-cast - clang-diagnostic-undefined-arm-streaming - clang-diagnostic-undefined-arm-za - clang-diagnostic-undefined-arm-zt0 - clang-diagnostic-unknown-directives - clang-diagnostic-unreachable-code-generic-assoc - clang-diagnostic-unsafe-buffer-usage - clang-diagnostic-vla-cxx-extension - clang-diagnostic-vla-extension-static-assert - cppcoreguidelines-avoid-capturing-lambda-coroutines - cppcoreguidelines-avoid-do-while - cppcoreguidelines-avoid-reference-coroutine-parameters - cppcoreguidelines-misleading-capture-default-by-value - cppcoreguidelines-missing-std-forward - cppcoreguidelines-no-suspend-with-lock - cppcoreguidelines-noexcept-destructor - cppcoreguidelines-noexcept-move-operations - cppcoreguidelines-noexcept-swap - cppcoreguidelines-rvalue-reference-param-not-moved - cppcoreguidelines-use-default-member-init - hicpp-ignored-remove-result - llvmlibc-inline-function-decl - misc-coroutine-hostile-raii - misc-header-include-cycle - misc-include-cleaner - modernize-type-traits - modernize-use-constraints - modernize-use-starts-ends-with - modernize-use-std-numbers - modernize-use-std-print - performance-avoid-endl - performance-enum-size - performance-noexcept-destructor - performance-noexcept-swap - readability-avoid-nested-conditional-operator - readability-avoid-return-with-void-value - readability-avoid-unconditional-preprocessor-if - readability-operators-representation - readability-redundant-casting - readability-redundant-inline-specifier - readability-reference-to-constructed-temporary - new Clang Static Analyzer rules - BitwiseShift - EnumCastOutOfRange - security.cert.env.InvalidPtr - unix.Errno - unix.StdCLibraryFunctions - add VisualStudio project for development/debugging - diagnostic.json: using name 'Summary' instead of 'Text' for description --- cxx-sensors/src/main/resources/clangsa.xml | 60 + cxx-sensors/src/main/resources/clangtidy.xml | 19279 ++++++++++------ .../clangsa/CxxClangSARuleRepositoryTest.java | 2 +- .../CxxClangTidyRuleRepositoryTest.java | 2 +- .../src/tools/clangtidy_createrules.py | 6 +- .../src/tools/clangtidy_createrules.pyproj | 39 + .../src/tools/clangtidy_createrules.sln | 23 + 7 files changed, 11922 insertions(+), 7489 deletions(-) create mode 100644 cxx-sensors/src/tools/clangtidy_createrules.pyproj create mode 100644 cxx-sensors/src/tools/clangtidy_createrules.sln diff --git a/cxx-sensors/src/main/resources/clangsa.xml b/cxx-sensors/src/main/resources/clangsa.xml index e69270f822..ce00ada1d5 100644 --- a/cxx-sensors/src/main/resources/clangsa.xml +++ b/cxx-sensors/src/main/resources/clangsa.xml @@ -21,6 +21,18 @@ Follow these steps to make your custom rules available in SonarQube: + + core.BitwiseShift + core.BitwiseShift + +Finds cases where bitwise shift operation causes undefined behaviour. +

+

References

Available Checkers

+]]>
+ BUG + core +
core.CallAndMessage core.CallAndMessage @@ -345,6 +357,18 @@ Rules list was generated based on clang version 16.0.0 (https://github.com/llvm/ BUG nullability + + optin.core.EnumCastOutOfRange + optin.core.EnumCastOutOfRange + +Check integer to enumeration casts for out of range values +

+

References

Available Checkers

+]]>
+ BUG + optin +
optin.cplusplus.UninitializedObject optin.cplusplus.UninitializedObject @@ -807,6 +831,18 @@ Rules list was generated based on clang version 16.0.0 (https://github.com/llvm/ Warn on using a floating point value as a loop counter (CERT: FLP30-C, FLP30-CPP) +

+

References

Available Checkers

+]]>
+ BUG + security +
+ + security.cert.env.InvalidPtr + security.cert.env.InvalidPtr + +Finds usages of possibly invalidated pointers

References

Available Checkers

]]>
@@ -975,6 +1011,18 @@ Rules list was generated based on clang version 16.0.0 (https://github.com/llvm/ Check calls to various UNIX/Posix functions +

+

References

Available Checkers

+]]>
+ BUG + unix +
+ + unix.Errno + unix.Errno + +Check for improper use of 'errno'

References

Available Checkers

]]>
@@ -1011,6 +1059,18 @@ Rules list was generated based on clang version 16.0.0 (https://github.com/llvm/ Check for mismatched deallocators. +

+

References

Available Checkers

+]]>
+ BUG + unix +
+ + unix.StdCLibraryFunctions + unix.StdCLibraryFunctions + +Check for invalid arguments of C standard library functions, and apply relations between arguments and return value

References

Available Checkers

]]>
diff --git a/cxx-sensors/src/main/resources/clangtidy.xml b/cxx-sensors/src/main/resources/clangtidy.xml index 09c8540524..aeaab60b96 100644 --- a/cxx-sensors/src/main/resources/clangtidy.xml +++ b/cxx-sensors/src/main/resources/clangtidy.xml @@ -3,7 +3,7 @@ C and C++ rules from * https://clang.llvm.org/extra/clang-tidy/checks/list.html * https://clang-analyzer.llvm.org/available_checks.html - * last update: llvmorg-16-init-15404-g61be26154924 (git describe) + * last update: llvmorg-19-init (git describe) --> @@ -54,6 +54,28 @@ + + abseil-cleanup-ctad + abseil-cleanup-ctad + + +

clang-tidy - abseil-cleanup-ctad

+ +

abseil-cleanup-ctad

+

Suggests switching the initialization pattern of absl::Cleanup instances from the factory function to class template argument deduction (CTAD), in C++17 and higher.

+
auto c1 = absl::MakeCleanup([] {});
+
+const auto c2 = absl::MakeCleanup(std::function<void()>([] {}));
+

becomes

+
absl::Cleanup c1 = [] {};
+
+const absl::Cleanup c2 = std::function<void()>([] {});
+

References

+

clang.llvm.org

]]> + +
+ INFO +
abseil-duration-addition abseil-duration-addition @@ -442,7 +464,9 @@ absl::StrAppend(&s, "E", "F", "G");

clang-tidy - abseil-string-find-startswith

abseil-string-find-startswith

-

Checks whether a std::string::find() or std::string::rfind() result is compared with 0, and suggests replacing with absl::StartsWith(). This is both a readability and performance issue.

+

Checks whether a std::string::find() or std::string::rfind() (and corresponding std::string_view methods) result is compared with 0, and suggests replacing with absl::StartsWith(). This is both a readability and performance issue.

+

starts_with was added as a built-in function on those types in C++20. If available, prefer enabling modernize-use-starts-ends-with +<../modernize/use-starts-ends-with> instead of this check.

string s = "...";
 if (s.find("Hello World") == 0) { /* do something */ }
 if (s.rfind("Hello World", 0) == 0) { /* do something */ }
@@ -453,7 +477,7 @@ if (absl::StartsWith(s, "Hello World")) { /* do something */ }<

Options

StringLikeClasses

-

Semicolon-separated list of names of string-like classes. By default only std::basic_string is considered. The list of methods to considered is fixed.

+

Semicolon-separated list of names of string-like classes. By default both std::basic_string and std::basic_string_view are considered. The list of methods to be considered is fixed.

IncludeStyle

@@ -1324,6 +1348,29 @@ foo(/*Value=*/nullptr); MINOR BUG + + bugprone-assignment-in-if-condition + bugprone-assignment-in-if-condition + + +

clang-tidy - bugprone-assignment-in-if-condition

+
+

bugprone-assignment-in-if-condition

+

Finds assignments within conditions of if statements. Such assignments are bug-prone because they may have been intended as equality tests.

+

This check finds all assignments within if conditions, including ones that are not flagged by -Wparentheses due to an extra set of parentheses, and including assignments that call an overloaded operator=(). The identified assignments violate BARR group "Rule 8.2.c".

+
int f = 3;
+if(f = 4) { // This is identified by both `Wparentheses` and this check - should it have been: `if (f == 4)` ?
+  f = f + 1;
+}
+
+if((f == 5) || (f = 6)) { // the assignment here `(f = 6)` is identified by this check, but not by `-Wparentheses`. Should it have been `(f == 6)` ?
+  f = f + 2;
+}
+

References

+

clang.llvm.org

]]> + + INFO +
bugprone-bad-signal-to-kill-thread bugprone-bad-signal-to-kill-thread @@ -1333,9 +1380,7 @@ foo(/*Value=*/nullptr);

bugprone-bad-signal-to-kill-thread

Finds pthread_kill function calls when a thread is terminated by raising SIGTERM signal and the signal kills the entire process, not just the individual thread. Use any signal except SIGTERM.

-
-

pthread_kill(thread, SIGTERM);

-
+
pthread_kill(thread, SIGTERM);

This check corresponds to the CERT C Coding Standard rule POS44-C. Do not use signals to terminate threads.

References

clang.llvm.org

]]> @@ -1410,6 +1455,7 @@ default: return 10; }

Here the check does not warn for the repeated return 10;, which is good if we want to preserve that 'a' is before 'b' and default: is the last branch.

+

Switch cases marked with the [[fallthrough]] attribute are ignored.

Finally, the check also examines conditional operators and reports code like:

return test_value(x) ? x : x;

Unlike if statements, the check does not detect chains of conditional operators.

@@ -1419,6 +1465,116 @@ default: INFO
+ + bugprone-casting-through-void + bugprone-casting-through-void + + +

clang-tidy - bugprone-casting-through-void

+ +

bugprone-casting-through-void

+

Detects unsafe or redundant two-step casting operations involving void*.

+

Two-step type conversions via void* are discouraged for several reasons.

+
    +
  • They obscure code and impede its understandability, complicating maintenance.
  • +
  • These conversions bypass valuable compiler support, erasing warnings related to pointer alignment. It may violate strict aliasing rule and leading to undefined behavior.
  • +
  • In scenarios involving multiple inheritance, ambiguity and unexpected outcomes can arise due to the loss of type information, posing runtime issues.
  • +
+

In summary, avoiding two-step type conversions through void* ensures clearer code, maintains essential compiler warnings, and prevents ambiguity and potential runtime errors, particularly in complex inheritance scenarios.

+

Examples:

+
using IntegerPointer = int *;
+double *ptr;
+
+static_cast<IntegerPointer>(static_cast<void *>(ptr)); // WRONG
+reinterpret_cast<IntegerPointer>(reinterpret_cast<void *>(ptr)); // WRONG
+(IntegerPointer)(void *)ptr; // WRONG
+IntegerPointer(static_cast<void *>(ptr)); // WRONG
+

References

+

clang.llvm.org

]]> +
+ INFO +
+ + bugprone-chained-comparison + bugprone-chained-comparison + + +

clang-tidy - bugprone-chained-comparison

+ +

bugprone-chained-comparison

+

Check detects chained comparison operators that can lead to unintended behavior or logical errors.

+

Chained comparisons are expressions that use multiple comparison operators to compare three or more values. For example, the expression a < b < c compares the values of a, b, and c. However, this expression does not evaluate as (a < b) && (b < c), which is probably what the developer intended. Instead, it evaluates as (a < b) < c, which may produce unintended results, especially when the types of a, b, and c are different.

+

To avoid such errors, the check will issue a warning when a chained comparison operator is detected, suggesting to use parentheses to specify the order of evaluation or to use a logical operator to separate comparison expressions.

+

Consider the following examples:

+
int a = 2, b = 6, c = 4;
+if (a < b < c) {
+    // This block will be executed
+}
+

In this example, the developer intended to check if a is less than b and b is less than c. However, the expression a < b < c is equivalent to (a < b) < c. Since a < b is true, the expression (a < b) < c is evaluated as 1 < c, which is equivalent to true < c and is invalid in this case as b < c is false.

+

Even that above issue could be detected as comparison of int to bool, there is more dangerous example:

+
bool a = false, b = false, c = true;
+if (a == b == c) {
+    // This block will be executed
+}
+

In this example, the developer intended to check if a, b, and c are all equal. However, the expression a == b == c is evaluated as (a == b) == c. Since a == b is true, the expression (a == b) == c is evaluated as true == c, which is equivalent to true == true. This comparison yields true, even though a and b are false, and are not equal to c.

+

To avoid this issue, the developer can use a logical operator to separate the comparison expressions, like this:

+
if (a == b && b == c) {
+    // This block will not be executed
+}
+

Alternatively, use of parentheses in the comparison expressions can make the developer's intention more explicit and help avoid misunderstanding.

+
if ((a == b) == c) {
+    // This block will be executed
+}
+

References

+

clang.llvm.org

]]> +
+ INFO +
+ + bugprone-compare-pointer-to-member-virtual-function + bugprone-compare-pointer-to-member-virtual-function + + +

clang-tidy - bugprone-compare-pointer-to-member-virtual-function

+ +

bugprone-compare-pointer-to-member-virtual-function

+

Detects unspecified behavior about equality comparison between pointer to member virtual function and anything other than null-pointer-constant.

+
struct A {
+  void f1();
+  void f2();
+  virtual void f3();
+  virtual void f4();
+
+  void g1(int);
+};
+
+void fn() {
+  bool r1 = (&A::f1 == &A::f2);  // ok
+  bool r2 = (&A::f1 == &A::f3);  // bugprone
+  bool r3 = (&A::f1 != &A::f3);  // bugprone
+  bool r4 = (&A::f3 == nullptr); // ok
+  bool r5 = (&A::f3 == &A::f4);  // bugprone
+
+  void (A::*v1)() = &A::f3;
+  bool r6 = (v1 == &A::f1); // bugprone
+  bool r6 = (v1 == nullptr); // ok
+
+  void (A::*v2)() = &A::f2;
+  bool r7 = (v2 == &A::f1); // false positive, but potential risk if assigning other value to v2.
+
+  void (A::*v3)(int) = &A::g1;
+  bool r8 = (v3 == &A::g1); // ok, no virtual function match void(A::*)(int) signature.
+}
+

Provide warnings on equality comparisons involve pointers to member virtual function or variables which is potential pointer to member virtual function and any entity other than a null-pointer constant.

+

In certain compilers, virtual function addresses are not conventional pointers but instead consist of offsets and indexes within a virtual function table (vtable). Consequently, these pointers may vary between base and derived classes, leading to unpredictable behavior when compared directly. This issue becomes particularly challenging when dealing with pointers to pure virtual functions, as they may not even have a valid address, further complicating comparisons.

+

Instead, it is recommended to utilize the typeid operator or other appropriate mechanisms for comparing objects to ensure robust and predictable behavior in your codebase. By heeding this detection and adopting a more reliable comparison method, you can mitigate potential issues related to unspecified behavior, especially when dealing with pointers to member virtual functions or pure virtual functions, thereby improving the overall stability and maintainability of your code. In scenarios involving pointers to member virtual functions, it's only advisable to employ nullptr for comparisons.

+

Limitations

+

Does not analyze values stored in a variable. For variable, only analyze all virtual methods in the same class or struct and diagnose when assigning a pointer to member virtual function to this variable is possible.

+

References

+

clang.llvm.org

]]> +
+ INFO +
bugprone-copy-constructor-init bugprone-copy-constructor-init @@ -1432,14 +1588,23 @@ default: public: Copyable() = default; Copyable(const Copyable &) = default; + + int memberToBeCopied = 0; }; class X2 : public Copyable { X2(const X2 &other) {} // Copyable(other) is missing };

Also finds copy constructors where the constructor of the base class don't have parameter.

-
class X4 : public Copyable {
-  X4(const X4 &other) : Copyable() {} // other is missing
+
class X3 : public Copyable {
+  X3(const X3 &other) : Copyable() {} // other is missing
 };
+

Failure to properly initialize base class sub-objects during copy construction can result in undefined behavior, crashes, data corruption, or other unexpected outcomes. The check ensures that the copy constructor of a derived class properly calls the copy constructor of the base class, helping to prevent bugs and improve code quality.

+

Limitations:

+
    +
  • It won't generate warnings for empty classes, as there are no class members (including base class sub-objects) to worry about.
  • +
  • It won't generate warnings for base classes that have copy constructor private or deleted.
  • +
  • It won't generate warnings for base classes that are initialized using other non-default constructor, as this could be intentional.
  • +

The check also suggests a fix-its in some cases.

References

clang.llvm.org

]]> @@ -1569,7 +1734,7 @@ void compare(const char *CharBuf, std::string String) { /* ... */ }

Currently, the following heuristics are implemented which will suppress the warning about the parameter pair involved:

  • The parameters are used in the same expression, e.g. f(a, b) or a < b.

  • -
  • The parameters are further passed to the same function to the same parameter of that function, of the same overload. e.g. f(a, 1) and f(b, 2) to some f(T, int).

    +
  • The parameters are further passed to the same function to the same parameter of that function, of the same overload. E.g. f(a, 1) and f(b, 2) to some f(T, int).

    Note

    @@ -1634,6 +1799,85 @@ void cStr(StringView SV, const char *Buf() { /* ... */ } INFO + + bugprone-empty-catch + bugprone-empty-catch + + +

    clang-tidy - bugprone-empty-catch

    +
    +

    bugprone-empty-catch

    +

    Detects and suggests addressing issues with empty catch statements.

    +
    try {
    +  // Some code that can throw an exception
    +} catch(const std::exception&) {
    +}
    +

    Having empty catch statements in a codebase can be a serious problem that developers should be aware of. Catch statements are used to handle exceptions that are thrown during program execution. When an exception is thrown, the program jumps to the nearest catch statement that matches the type of the exception.

    +

    Empty catch statements, also known as "swallowing" exceptions, catch the exception but do nothing with it. This means that the exception is not handled properly, and the program continues to run as if nothing happened. This can lead to several issues, such as:

    +
      +
    • Hidden Bugs: If an exception is caught and ignored, it can lead to hidden bugs that are difficult to diagnose and fix. The root cause of the problem may not be apparent, and the program may continue to behave in unexpected ways.
    • +
    • Security Issues: Ignoring exceptions can lead to security issues, such as buffer overflows or null pointer dereferences. Hackers can exploit these vulnerabilities to gain access to sensitive data or execute malicious code.
    • +
    • Poor Code Quality: Empty catch statements can indicate poor code quality and a lack of attention to detail. This can make the codebase difficult to maintain and update, leading to longer development cycles and increased costs.
    • +
    • Unreliable Code: Code that ignores exceptions is often unreliable and can lead to unpredictable behavior. This can cause frustration for users and erode trust in the software.
    • +
    +

    To avoid these issues, developers should always handle exceptions properly. This means either fixing the underlying issue that caused the exception or propagating the exception up the call stack to a higher-level handler. If an exception is not important, it should still be logged or reported in some way so that it can be tracked and addressed later.

    +

    If the exception is something that can be handled locally, then it should be handled within the catch block. This could involve logging the exception or taking other appropriate action to ensure that the exception is not ignored.

    +

    Here is an example:

    +
    try {
    +  // Some code that can throw an exception
    +} catch (const std::exception& ex) {
    +  // Properly handle the exception, e.g.:
    +  std::cerr << "Exception caught: " << ex.what() << std::endl;
    +}
    +

    If the exception cannot be handled locally and needs to be propagated up the call stack, it should be re-thrown or new exception should be thrown.

    +

    Here is an example:

    +
    try {
    +  // Some code that can throw an exception
    +} catch (const std::exception& ex) {
    +  // Re-throw the exception
    +  throw;
    +}
    +

    In some cases, catching the exception at this level may not be necessary, and it may be appropriate to let the exception propagate up the call stack. This can be done simply by not using try/catch block.

    +

    Here is an example:

    +
    void function() {
    +  // Some code that can throw an exception
    +}
    +
    +void callerFunction() {
    +  try {
    +    function();
    +  } catch (const std::exception& ex) {
    +    // Handling exception on higher level
    +    std::cerr << "Exception caught: " << ex.what() << std::endl;
    +  }
    +}
    +

    Other potential solution to avoid empty catch statements is to modify the code to avoid throwing the exception in the first place. This can be achieved by using a different API, checking for error conditions beforehand, or handling errors in a different way that does not involve exceptions. By eliminating the need for try-catch blocks, the code becomes simpler and less error-prone.

    +

    Here is an example:

    +
    // Old code:
    +try {
    +  mapContainer["Key"].callFunction();
    +} catch(const std::out_of_range&) {
    +}
    +
    +// New code
    +if (auto it = mapContainer.find("Key"); it != mapContainer.end()) {
    +  it->second.callFunction();
    +}
    +

    In conclusion, empty catch statements are a bad practice that can lead to hidden bugs, security issues, poor code quality, and unreliable code. By handling exceptions properly, developers can ensure that their code is robust, secure, and maintainable.

    +

    Options

    +
    +

    IgnoreCatchWithKeywords

    +

    This option can be used to ignore specific catch statements containing certain keywords. If a catch statement body contains (case-insensitive) any of the keywords listed in this semicolon-separated option, then the catch will be ignored, and no warning will be raised. Default value: @TODO;@FIXME.

    +
    +
    +

    AllowEmptyCatchForExceptions

    +

    This option can be used to ignore empty catch statements for specific exception types. By default, the check will raise a warning if an empty catch statement is detected, regardless of the type of exception being caught. However, in certain situations, such as when a developer wants to intentionally ignore certain exceptions or handle them in a different way, it may be desirable to allow empty catch statements for specific exception types. To configure this option, a semicolon-separated list of exception type names should be provided. If an exception type name in the list is caught in an empty catch statement, no warning will be raised. Default value: empty string.

    +
    +

    References

    +

    clang.llvm.org

    ]]> + + INFO + bugprone-exception-escape bugprone-exception-escape @@ -1649,10 +1893,13 @@ void cStr(StringView SV, const char *Buf() { /* ... */ }
  • Move assignment operators
  • The main() functions
  • swap() functions
  • +
  • iter_swap() functions
  • +
  • iter_move() functions
  • Functions marked with throw() or noexcept
  • Other functions given as option

A destructor throwing an exception may result in undefined behavior, resource leaks or unexpected termination of the program. Throwing move constructor or move assignment also may result in undefined behavior or resource leak. The swap() operations expected to be non throwing most of the cases and they are always possible to implement in a non throwing way. Non throwing swap() operations are also used to create move operations. A throwing main() function also results in unexpected termination.

+

Functions declared explicitly with noexcept(false) or throw(exception) will be excluded from the analysis, as even though it is not recommended for functions like swap(), main(), move constructors, move assignment operators and destructors, it is a clear indication of the developer's intention and should be respected.

WARNING! This check may be expensive on large source files.

Options

@@ -1742,10 +1989,20 @@ public: template<typename... A, enable_if_t<is_constructible_v<tuple<string, int>, A&&...>, int> = 0> explicit Person(A&&... a) {} + + // C5: perfect forwarding ctor guarded with requires expression + template<typename T> + requires requires { is_special<T>; } + explicit Person(T&& n) {} + + // C6: perfect forwarding ctor guarded with concept requirement + template<Special T> + explicit Person(T&& n) {} + // (possibly compiler generated) copy ctor Person(const Person& rhs); }; -

The check warns for constructors C1 and C2, because those can hide copy and move constructors. We suppress warnings if the copy and the move constructors are both disabled (deleted or private), because there is nothing the perfect forwarding constructor could hide in this case. We also suppress warnings for constructors like C3 and C4 that are guarded with an enable_if, assuming the programmer was aware of the possible hiding.

+

The check warns for constructors C1 and C2, because those can hide copy and move constructors. We suppress warnings if the copy and the move constructors are both disabled (deleted or private), because there is nothing the perfect forwarding constructor could hide in this case. We also suppress warnings for constructors like C3-C6 that are guarded with an enable_if or a concept, assuming the programmer was aware of the possible hiding.

Background

For deciding whether a constructor is guarded with enable_if, we consider the types of the constructor parameters, the default values of template type parameters and the types of non-type template parameters with a default literal value. If any part of these types is std::enable_if or std::enable_if_t, we assume the constructor is guarded.

References

@@ -1822,6 +2079,77 @@ xs.erase(std::remove(xs.begin(), xs.end(), 10), xs.end()); MINOR BUG + + bugprone-inc-dec-in-conditions + bugprone-inc-dec-in-conditions + + +

clang-tidy - bugprone-inc-dec-in-conditions

+
+

bugprone-inc-dec-in-conditions

+

Detects when a variable is both incremented/decremented and referenced inside a complex condition and suggests moving them outside to avoid ambiguity in the variable's value.

+

When a variable is modified and also used in a complex condition, it can lead to unexpected behavior. The side-effect of changing the variable's value within the condition can make the code difficult to reason about. Additionally, the developer's intended timing for the modification of the variable may not be clear, leading to misunderstandings and errors. This can be particularly problematic when the condition involves logical operators like && and ||, where the order of evaluation can further complicate the situation.

+

Consider the following example:

+
int i = 0;
+// ...
+if (i++ < 5 && i > 0) {
+  // do something
+}
+

In this example, the result of the expression may not be what the developer intended. The original intention of the developer could be to increment i after the entire condition is evaluated, but in reality, i will be incremented before i > 0 is executed. This can lead to unexpected behavior and bugs in the code. To fix this issue, the developer should separate the increment operation from the condition and perform it separately. For example, they can increment i in a separate statement before or after the condition is evaluated. This ensures that the value of i is predictable and consistent throughout the code.

+
int i = 0;
+// ...
+i++;
+if (i <= 5 && i > 0) {
+  // do something
+}
+

Another common issue occurs when multiple increments or decrements are performed on the same variable inside a complex condition. For example:

+
int i = 4;
+// ...
+if (i++ < 5 || --i > 2) {
+  // do something
+}
+

There is a potential issue with this code due to the order of evaluation in C++. The || operator used in the condition statement guarantees that if the first operand evaluates to true, the second operand will not be evaluated. This means that if i were initially 4, the first operand i < 5 would evaluate to true and the second operand i > 2 would not be evaluated. As a result, the decrement operation --i would not be executed and i would hold value 5, which may not be the intended behavior for the developer.

+

To avoid this potential issue, the both increment and decrement operation on i should be moved outside the condition statement.

+

References

+

clang.llvm.org

]]> + + INFO +
+ + bugprone-incorrect-enable-if + bugprone-incorrect-enable-if + + +

clang-tidy - bugprone-incorrect-enable-if

+ +

bugprone-incorrect-enable-if

+

Detects incorrect usages of std::enable_if that don't name the nested type type.

+

In C++11 introduced std::enable_if as a convenient way to leverage SFINAE. One form of using std::enable_if is to declare an unnamed template type parameter with a default type equal to typename std::enable_if<condition>::type. If the author forgets to name the nested type type, then the code will always consider the candidate template even if the condition is not met.

+

Below are some examples of code using std::enable_if correctly and incorrect examples that this check flags.

+
template <typename T, typename = typename std::enable_if<T::some_trait>::type>
+void valid_usage() { ... }
+
+template <typename T, typename = std::enable_if_t<T::some_trait>>
+void valid_usage_with_trait_helpers() { ... }
+
+// The below code is not a correct application of SFINAE. Even if
+// T::some_trait is not true, the function will still be considered in the
+// set of function candidates. It can either incorrectly select the function
+// when it should not be a candidates, and/or lead to hard compile errors
+// if the body of the template does not compile if the condition is not
+// satisfied.
+template <typename T, typename = std::enable_if<T::some_trait>>
+void invalid_usage() { ... }
+
+// The tool suggests the following replacement for 'invalid_usage':
+template <typename T, typename = typename std::enable_if<T::some_trait>::type>
+void fixed_invalid_usage() { ... }
+

C++14 introduced the trait helper std::enable_if_t which reduces the likelihood of this error. C++20 introduces constraints, which generally supersede the use of std::enable_if. See modernize-type-traits <../modernize/type-traits> for another tool that will replace std::enable_if with std::enable_if_t, and see modernize-use-constraints <../modernize/use-constraints> for another tool that replaces std::enable_if with C++20 constraints. Consider these newer mechanisms where possible.

+

References

+

clang.llvm.org

]]> +
+ INFO +
bugprone-incorrect-roundings bugprone-incorrect-roundings @@ -1930,6 +2258,11 @@ Now called from operator()

Likely intended output:

Called from FancyFunction
 Now called from FancyFunction
+

Options

+
+

IgnoreMacros

+

The value true specifies that attempting to get the name of a function from within a macro should not be diagnosed. The default value is false.

+

References

clang.llvm.org

]]> @@ -2088,6 +2421,109 @@ foo(s); MINOR BUG
+ + bugprone-multi-level-implicit-pointer-conversion + bugprone-multi-level-implicit-pointer-conversion + + +

clang-tidy - bugprone-multi-level-implicit-pointer-conversion

+ +

bugprone-multi-level-implicit-pointer-conversion

+

Detects implicit conversions between pointers of different levels of indirection.

+

Conversions between pointer types of different levels of indirection can be dangerous and may lead to undefined behavior, particularly if the converted pointer is later cast to a type with a different level of indirection. For example, converting a pointer to a pointer to an int (int**) to a void* can result in the loss of information about the original level of indirection, which can cause problems when attempting to use the converted pointer. If the converted pointer is later cast to a type with a different level of indirection and dereferenced, it may lead to access violations, memory corruption, or other undefined behavior.

+

Consider the following example:

+
void foo(void* ptr);
+
+int main() {
+  int x = 42;
+  int* ptr = &x;
+  int** ptr_ptr = &ptr;
+  foo(ptr_ptr); // warning will trigger here
+  return 0;
+}
+

In this example, foo() is called with ptr_ptr as its argument. However, ptr_ptr is a int** pointer, while foo() expects a void* pointer. This results in an implicit pointer level conversion, which could cause issues if foo() dereferences the pointer assuming it's a int* pointer.

+

Using an explicit cast is a recommended solution to prevent issues caused by implicit pointer level conversion, as it allows the developer to explicitly state their intention and show their reasoning for the type conversion. Additionally, it is recommended that developers thoroughly check and verify the safety of the conversion before using an explicit cast. This extra level of caution can help catch potential issues early on in the development process, improving the overall reliability and maintainability of the code.

+

References

+

clang.llvm.org

]]> +
+ INFO +
+ + bugprone-multiple-new-in-one-expression + bugprone-multiple-new-in-one-expression + + +

clang-tidy - bugprone-multiple-new-in-one-expression

+ +

bugprone-multiple-new-in-one-expression

+

Finds multiple new operator calls in a single expression, where the allocated memory by the first new may leak if the second allocation fails and throws exception.

+

C++ does often not specify the exact order of evaluation of the operands of an operator or arguments of a function. Therefore if a first allocation succeeds and a second fails, in an exception handler it is not possible to tell which allocation has failed and free the memory. Even if the order is fixed the result of a first new may be stored in a temporary location that is not reachable at the time when a second allocation fails. It is best to avoid any expression that contains more than one operator new call, if exception handling is used to check for allocation errors.

+

Different rules apply for are the short-circuit operators || and && and the , operator, where evaluation of one side must be completed before the other starts. Expressions of a list-initialization (initialization or construction using { and } characters) are evaluated in fixed order. Similarly, condition of a ? operator is evaluated before the branches are evaluated.

+

The check reports warning if two new calls appear in one expression at different sides of an operator, or if new calls appear in different arguments of a function call (that can be an object construction with () syntax). These new calls can be nested at any level. For any warning to be emitted the new calls should be in a code block where exception handling is used with catch for std::bad_alloc or std::exception. At ||, &&, ,, ? (condition and one branch) operators no warning is emitted. No warning is emitted if both of the memory allocations are not assigned to a variable or not passed directly to a function. The reason is that in this case the memory may be intentionally not freed or the allocated objects can be self-destructing objects.

+

Examples:

+
struct A {
+  int Var;
+};
+struct B {
+  B();
+  B(A *);
+  int Var;
+};
+struct C {
+  int *X1;
+  int *X2;
+};
+
+void f(A *, B *);
+int f1(A *);
+int f1(B *);
+bool f2(A *);
+
+void foo() {
+  A *PtrA;
+  B *PtrB;
+  try {
+    // Allocation of 'B'/'A' may fail after memory for 'A'/'B' was allocated.
+    f(new A, new B); // warning: memory allocation may leak if an other allocation is sequenced after it and throws an exception; order of these allocations is undefined
+
+    // List (aggregate) initialization is used.
+    C C1{new int, new int}; // no warning
+
+    // Allocation of 'B'/'A' may fail after memory for 'A'/'B' was allocated but not yet passed to function 'f1'.
+    int X = f1(new A) + f1(new B); // warning: memory allocation may leak if an other allocation is sequenced after it and throws an exception; order of these allocations is undefined
+
+    // Allocation of 'B' may fail after memory for 'A' was allocated.
+    // From C++17 on memory for 'B' is allocated first but still may leak if allocation of 'A' fails.
+    PtrB = new B(new A); // warning: memory allocation may leak if an other allocation is sequenced after it and throws an exception
+
+    // 'new A' and 'new B' may be performed in any order.
+    // 'new B'/'new A' may fail after memory for 'A'/'B' was allocated but not assigned to 'PtrA'/'PtrB'.
+    (PtrA = new A)->Var = (PtrB = new B)->Var; // warning: memory allocation may leak if an other allocation is sequenced after it and throws an exception; order of these allocations is undefined
+
+    // Evaluation of 'f2(new A)' must be finished before 'f1(new B)' starts.
+    // If 'new B' fails the allocated memory for 'A' is supposedly handled correctly because function 'f2' could take the ownership.
+    bool Z = f2(new A) || f1(new B); // no warning
+
+    X = (f2(new A) ? f1(new A) : f1(new B)); // no warning
+
+    // No warning if the result of both allocations is not passed to a function
+    // or stored in a variable.
+    (new A)->Var = (new B)->Var; // no warning
+
+    // No warning if at least one non-throwing allocation is used.
+    f(new(std::nothrow) A, new B); // no warning
+  } catch(std::bad_alloc) {
+  }
+
+  // No warning if the allocation is outside a try block (or no catch handler exists for std::bad_alloc).
+  // (The fact if exceptions can escape from 'foo' is not taken into account.)
+  f(new A, new B); // no warning
+}
+

References

+

clang.llvm.org

]]> +
+ INFO +
bugprone-multiple-statement-macro bugprone-multiple-statement-macro @@ -2107,6 +2543,23 @@ if (do_increment) MINOR BUG + + bugprone-narrowing-conversions + bugprone-narrowing-conversions + + +

clang-tidy - bugprone-narrowing-conversions

+ +
+ +
+

bugprone-narrowing-conversions

+

The bugprone-narrowing-conversions check is an alias, please see cppcoreguidelines-narrowing-conversions <../cppcoreguidelines/narrowing-conversions> for more information.

+

References

+

clang.llvm.org

]]> +
+ INFO +
bugprone-no-escape bugprone-no-escape @@ -2129,6 +2582,42 @@ if (do_increment) INFO + + bugprone-non-zero-enum-to-bool-conversion + bugprone-non-zero-enum-to-bool-conversion + + +

clang-tidy - bugprone-non-zero-enum-to-bool-conversion

+ +

bugprone-non-zero-enum-to-bool-conversion

+

Detect implicit and explicit casts of enum type into bool where enum type doesn't have a zero-value enumerator. If the enum is used only to hold values equal to its enumerators, then conversion to bool will always result in true value. This can lead to unnecessary code that reduces readability and maintainability and can result in bugs.

+

May produce false positives if the enum is used to store other values (used as a bit-mask or zero-initialized on purpose). To deal with them, // NOLINT or casting first to the underlying type before casting to bool can be used.

+

It is important to note that this check will not generate warnings if the definition of the enumeration type is not available. Additionally, C++11 enumeration classes are supported by this check.

+

Overall, this check serves to improve code quality and readability by identifying and flagging instances where implicit or explicit casts from enumeration types to boolean could cause potential issues.

+

Example

+
enum EStatus {
+  OK = 1,
+  NOT_OK,
+  UNKNOWN
+};
+
+void process(EStatus status) {
+  if (!status) {
+    // this true-branch won't be executed
+    return;
+  }
+  // proceed with "valid data"
+}
+

Options

+
+

EnumIgnoreList

+

Option is used to ignore certain enum types when checking for implicit/explicit casts to bool. It accepts a semicolon-separated list of (fully qualified) enum type names or regular expressions that match the enum type names. The default value is an empty string, which means no enums will be ignored.

+
+

References

+

clang.llvm.org

]]> +
+ INFO +
bugprone-not-null-terminated-result bugprone-not-null-terminated-result @@ -2198,36 +2687,94 @@ if (do_increment) BUG - bugprone-parent-virtual-call - bugprone-parent-virtual-call + bugprone-optional-value-conversion + bugprone-optional-value-conversion -

clang-tidy - bugprone-parent-virtual-call

+

clang-tidy - bugprone-optional-value-conversion

-

bugprone-parent-virtual-call

-

Detects and fixes calls to grand-...parent virtual methods instead of calls to overridden parent's virtual methods.

-
struct A {
-  int virtual foo() {...}
-};
+

bugprone-optional-value-conversion

+

Detects potentially unintentional and redundant conversions where a value is extracted from an optional-like type and then used to create a new instance of the same optional-like type.

+

These conversions might be the result of developer oversight, leftovers from code refactoring, or other situations that could lead to unintended exceptions or cases where the resulting optional is always initialized, which might be unexpected behavior.

+

To illustrate, consider the following problematic code snippet:

+
#include <optional>
 
-struct B: public A {
-  int foo() override {...}
-};
+void print(std::optional<int>);
 
-struct C: public B {
-  int foo() override { A::foo(); }
-//                     ^^^^^^^^
-// warning: qualified name A::foo refers to a member overridden in subclass; did you mean 'B'?  [bugprone-parent-virtual-call]
-};
-

References

-

clang.llvm.org

]]> - - - - bugprone-posix-return - bugprone-posix-return - - +int main() +{ + std::optional<int> opt; + // ... + + // Unintentional conversion from std::optional<int> to int and back to + // std::optional<int>: + print(opt.value()); + + // ... +}
+

A better approach would be to directly pass opt to the print function without extracting its value:

+
#include <optional>
+
+void print(std::optional<int>);
+
+int main()
+{
+  std::optional<int> opt;
+  // ...
+
+  // Proposed code: Directly pass the std::optional<int> to the print
+  // function.
+  print(opt);
+
+  // ...
+}
+

By passing opt directly to the print function, unnecessary conversions are avoided, and potential unintended behavior or exceptions are minimized.

+

Value extraction using operator * is matched by default. The support for non-standard optional types such as boost::optional or absl::optional may be limited.

+

Options:

+
+

OptionalTypes

+

Semicolon-separated list of (fully qualified) optional type names or regular expressions that match the optional types. Default value is ::std::optional;::absl::optional;::boost::optional.

+
+
+

ValueMethods

+

Semicolon-separated list of (fully qualified) method names or regular expressions that match the methods. Default value is ::value$;::get$.

+
+

References

+

clang.llvm.org

]]> +
+ INFO +
+ + bugprone-parent-virtual-call + bugprone-parent-virtual-call + + +

clang-tidy - bugprone-parent-virtual-call

+ +

bugprone-parent-virtual-call

+

Detects and fixes calls to grand-...parent virtual methods instead of calls to overridden parent's virtual methods.

+
struct A {
+  int virtual foo() {...}
+};
+
+struct B: public A {
+  int foo() override {...}
+};
+
+struct C: public B {
+  int foo() override { A::foo(); }
+//                     ^^^^^^^^
+// warning: qualified name A::foo refers to a member overridden in subclass; did you mean 'B'?  [bugprone-parent-virtual-call]
+};
+

References

+

clang.llvm.org

]]> +
+
+ + bugprone-posix-return + bugprone-posix-return + +

clang-tidy - bugprone-posix-return

bugprone-posix-return

@@ -2342,7 +2889,7 @@ int _g(); // disallowed in global namespace only

AllowedIdentifiers

-

Semicolon-separated list of names that the check ignores. Default is an empty list.

+

Semicolon-separated list of regular expressions that the check ignores. Default is an empty list.

References

clang.llvm.org

]]> @@ -2396,7 +2943,7 @@ struct S {
  • Calls to functions with non-C linkage are not allowed (including the signal handler itself).
  • The check is disabled on C++17 and later.

    -

    Asnychronous-safety is determined by comparing the function's name against a set of known functions. In addition, the function must come from a system header include and in a global namespace. The (possible) arguments passed to the function are not checked. Any function that cannot be determined to be asynchronous-safe is assumed to be non-asynchronous-safe by the check, including user functions for which only the declaration is visible. Calls to user-defined functions with visible definitions are checked recursively.

    +

    Asynchronous-safety is determined by comparing the function's name against a set of known functions. In addition, the function must come from a system header include and in a global namespace. The (possible) arguments passed to the function are not checked. Any function that cannot be determined to be asynchronous-safe is assumed to be non-asynchronous-safe by the check, including user functions for which only the declaration is visible. Calls to user-defined functions with visible definitions are checked recursively.

    This check implements the CERT C Coding Standard rule SIG30-C. Call only asynchronous-safe functions within signal handlers and the rule MSC54-CPP. A signal handler must be a plain old function. It has the alias names cert-sig30-c and cert-msc54-cpp.

    Options

    @@ -2630,22 +3177,13 @@ void getInt(int* dst) {

    bugprone-spuriously-wake-up-functions

    Finds cnd_wait, cnd_timedwait, wait, wait_for, or wait_until function calls when the function is not invoked from a loop that checks whether a condition predicate holds or the function has a condition parameter.

    -
    -
    -
    if (condition_predicate) {
    -

    condition.wait(lk);

    -
    -
    -

    }

    -
    -
    -
    -
    if (condition_predicate) {
    -

    if (thrd_success != cnd_wait(&condition, &lock)) { }

    -
    -
    -

    }

    -
    +
    if (condition_predicate) {
    +    condition.wait(lk);
    +}
    +
    if (condition_predicate) {
    +    if (thrd_success != cnd_wait(&condition, &lock)) {
    +    }
    +}

    This check corresponds to the CERT C++ Coding Standard rule CON54-CPP. Wrap functions that can spuriously wake up in a loop. and CERT C Coding Standard rule CON36-C. Wrap functions that can spuriously wake up in a loop.

    References

    clang.llvm.org

    ]]> @@ -2653,6 +3191,33 @@ void getInt(int* dst) { MINOR BUG
    + + bugprone-standalone-empty + bugprone-standalone-empty + + +

    clang-tidy - bugprone-standalone-empty

    + +

    bugprone-standalone-empty

    +

    Warns when empty() is used on a range and the result is ignored. Suggests clear() if it is an existing member function.

    +

    The empty() method on several common ranges returns a Boolean indicating whether or not the range is empty, but is often mistakenly interpreted as a way to clear the contents of a range. Some ranges offer a clear() method for this purpose. This check warns when a call to empty returns a result that is ignored, and suggests replacing it with a call to clear() if it is available as a member function of the range.

    +

    For example, the following code could be used to indicate whether a range is empty or not, but the result is ignored:

    +
    std::vector<int> v;
    +...
    +v.empty();
    +

    A call to clear() would appropriately clear the contents of the range:

    +
    std::vector<int> v;
    +...
    +v.clear();
    +

    Limitations:

    +
      +
    • Doesn't warn if empty() is defined and used with the ignore result in the class template definition (for example in the library implementation). These error cases can be caught with [[nodiscard]] attribute.
    • +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    bugprone-string-constructor bugprone-string-constructor @@ -2886,10 +3451,12 @@ flag |=

    Options

    HeaderFileExtensions

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. Please use the global configuration option HeaderFileExtensions.

    Default value: ";h;hh;hpp;hxx" A semicolon-separated list of filename extensions of header files (the filename extensions should not contain a "." prefix). For extension-less header files, use an empty string or leave an empty string between ";" if there are other filename extensions.

    ImplementationFileExtensions

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. Please use the global configuration option ImplementationFileExtensions.

    Default value: "c;cc;cpp;cxx" Likewise, a semicolon-separated list of filename extensions of implementation files.

    References

    @@ -3004,6 +3571,39 @@ const char* B[] = "This" " is a " "test";clang.llvm.org

    ]]>
    + + bugprone-suspicious-realloc-usage + bugprone-suspicious-realloc-usage + + +

    clang-tidy - bugprone-suspicious-realloc-usage

    + +

    bugprone-suspicious-realloc-usage

    +

    This check finds usages of realloc where the return value is assigned to the same expression as passed to the first argument: p = realloc(p, size); The problem with this construct is that if realloc fails it returns a null pointer but does not deallocate the original memory. If no other variable is pointing to it, the original memory block is not available any more for the program to use or free. In either case p = realloc(p, size); indicates bad coding style and can be replaced by q = realloc(p, size);.

    +

    The pointer expression (used at realloc) can be a variable or a field member of a data structure, but can not contain function calls or unresolved types.

    +

    In obvious cases when the pointer used at realloc is assigned to another variable before the realloc call, no warning is emitted. This happens only if a simple expression in form of q = p or void *q = p is found in the same function where p = realloc(p, ...) is found. The assignment has to be before the call to realloc (but otherwise at any place) in the same function. This suppression works only if p is a single variable.

    +

    Examples:

    +
    struct A {
    +  void *p;
    +};
    +
    +A &getA();
    +
    +void foo(void *p, A *a, int new_size) {
    +  p = realloc(p, new_size); // warning: 'p' may be set to null if 'realloc' fails, which may result in a leak of the original buffer
    +  a->p = realloc(a->p, new_size); // warning: 'a->p' may be set to null if 'realloc' fails, which may result in a leak of the original buffer
    +  getA().p = realloc(getA().p, new_size); // no warning
    +}
    +
    +void foo1(void *p, int new_size) {
    +  void *p1 = p;
    +  p = realloc(p, new_size); // no warning
    +}
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    bugprone-suspicious-semicolon bugprone-suspicious-semicolon @@ -3090,13 +3690,72 @@ if (strcmp(...) != 0) // Won't warn

    clang-tidy - bugprone-swapped-arguments

    bugprone-swapped-arguments

    -

    Finds potentially swapped arguments by looking at implicit conversions.

    +

    Finds potentially swapped arguments by examining implicit conversions. It analyzes the types of the arguments being passed to a function and compares them to the expected types of the corresponding parameters. If there is a mismatch or an implicit conversion that indicates a potential swap, a warning is raised.

    +
    void printNumbers(int a, float b);
    +
    +int main() {
    +  // Swapped arguments: float passed as int, int as float)
    +  printNumbers(10.0f, 5);
    +  return 0;
    +}
    +

    Covers a wide range of implicit conversions, including: - User-defined conversions - Conversions from floating-point types to boolean or integral types - Conversions from integral types to boolean or floating-point types - Conversions from boolean to integer types or floating-point types - Conversions from (member) pointers to boolean

    +

    It is important to note that for most argument swaps, the types need to match exactly. However, there are exceptions to this rule. Specifically, when the swapped argument is of integral type, an exact match is not always necessary. Implicit casts from other integral types are also accepted. Similarly, when dealing with floating-point arguments, implicit casts between different floating-point types are considered acceptable.

    +

    To avoid confusion, swaps where both swapped arguments are of integral types or both are of floating-point types do not trigger the warning. In such cases, it's assumed that the developer intentionally used different integral or floating-point types and does not raise a warning. This approach prevents false positives and provides flexibility in handling situations where varying integral or floating-point types are intentionally utilized.

    References

    clang.llvm.org

    ]]> MINOR BUG
    + + bugprone-switch-missing-default-case + bugprone-switch-missing-default-case + + +

    clang-tidy - bugprone-switch-missing-default-case

    + +

    bugprone-switch-missing-default-case

    +

    Ensures that switch statements without default cases are flagged, focuses only on covering cases with non-enums where the compiler may not issue warnings.

    +

    Switch statements without a default case can lead to unexpected behavior and incomplete handling of all possible cases. When a switch statement lacks a default case, if a value is encountered that does not match any of the specified cases, the program will continue execution without any defined behavior or handling.

    +

    This check helps identify switch statements that are missing a default case, allowing developers to ensure that all possible cases are handled properly. Adding a default case allows for graceful handling of unexpected or unmatched values, reducing the risk of program errors and unexpected behavior.

    +

    Example:

    +
    // Example 1:
    +// warning: switching on non-enum value without default case may not cover all cases
    +switch (i) {
    +case 0:
    +  break;
    +}
    +
    +// Example 2:
    +enum E { eE1 };
    +E e = eE1;
    +switch (e) { // no-warning
    +case eE1:
    +  break;
    +}
    +
    +// Example 3:
    +int i = 0;
    +switch (i) { // no-warning
    +case 0:
    +  break;
    +default:
    +  break;
    +}
    +
    +
    +

    Note

    +
    +

    Enum types are already covered by compiler warnings (comes under -Wswitch) when a switch statement does not handle all enum values. This check focuses on non-enum types where the compiler warnings may not be present.

    +
    +
    +

    The CppCoreGuideline ES.79 provide guidelines on switch statements, including the recommendation to always provide a default case.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    bugprone-terminating-continue bugprone-terminating-continue @@ -3173,77 +3832,243 @@ do { BUG - bugprone-undefined-memory-manipulation - bugprone-undefined-memory-manipulation - - -

    clang-tidy - bugprone-undefined-memory-manipulation

    - -

    bugprone-undefined-memory-manipulation

    -

    Finds calls of memory manipulation functions memset(), memcpy() and memmove() on not TriviallyCopyable objects resulting in undefined behavior.

    -

    References

    -

    clang.llvm.org

    ]]> -
    - BUG -
    - - bugprone-undelegated-constructor - bugprone-undelegated-constructor - - -

    clang-tidy - bugprone-undelegated-constructor

    - -

    bugprone-undelegated-constructor

    -

    Finds creation of temporary objects in constructors that look like a function call to another constructor of the same class.

    -

    The user most likely meant to use a delegating constructor or base class initializer.

    -

    References

    -

    clang.llvm.org

    ]]> -
    - MINOR - BUG -
    - - bugprone-unhandled-exception-at-new - bugprone-unhandled-exception-at-new + bugprone-unchecked-optional-access + bugprone-unchecked-optional-access -

    clang-tidy - bugprone-unhandled-exception-at-new

    +

    clang-tidy - bugprone-unchecked-optional-access

    -

    bugprone-unhandled-exception-at-new

    -

    Finds calls to new with missing exception handler for std::bad_alloc.

    -

    Calls to new may throw exceptions of type std::bad_alloc that should be handled. Alternatively, the nonthrowing form of new can be used. The check verifies that the exception is handled in the function that calls new.

    -

    If a nonthrowing version is used or the exception is allowed to propagate out of the function no warning is generated.

    -

    The exception handler is checked if it catches a std::bad_alloc or std::exception exception type, or all exceptions (catch-all). The check assumes that any user-defined operator new is either noexcept or may throw an exception of type std::bad_alloc (or one derived from it). Other exception class types are not taken into account.

    -
    int *f() noexcept {
    -  int *p = new int[1000]; // warning: missing exception handler for allocation failure at 'new'
    -  // ...
    -  return p;
    +

    bugprone-unchecked-optional-access

    +

    Note: This check uses a flow-sensitive static analysis to produce its results. Therefore, it may be more resource intensive (RAM, CPU) than the average clang-tidy check.

    +

    This check identifies unsafe accesses to values contained in std::optional<T>, absl::optional<T>, base::Optional<T>, or folly::Optional<T> objects. Below we will refer to all these types collectively as optional<T>.

    +

    An access to the value of an optional<T> occurs when one of its value, operator*, or operator-> member functions is invoked. To align with common misconceptions, the check considers these member functions as equivalent, even though there are subtle differences related to exceptions versus undefined behavior. See Additional notes, below, for more information on this topic.

    +

    An access to the value of an optional<T> is considered safe if and only if code in the local scope (for example, a function body) ensures that the optional<T> has a value in all possible execution paths that can reach the access. That should happen either through an explicit check, using the optional<T>::has_value member function, or by constructing the optional<T> in a way that shows that it unambiguously holds a value (e.g using std::make_optional which always returns a populated std::optional<T>).

    +

    Below we list some examples, starting with unsafe optional access patterns, followed by safe access patterns.

    +

    Unsafe access patterns

    +

    Access the value without checking if it exists

    +

    The check flags accesses to the value that are not locally guarded by existence check:

    +
    void f(std::optional<int> opt) {
    +  use(*opt); // unsafe: it is unclear whether `opt` has a value.
     }
    -
    int *f1() { // not 'noexcept'
    -  int *p = new int[1000]; // no warning: exception can be handled outside
    -                          // of this function
    -  // ...
    -  return p;
    +

    Access the value in the wrong branch

    +

    The check is aware of the state of an optional object in different branches of the code. For example:

    +
    void f(std::optional<int> opt) {
    +  if (opt.has_value()) {
    +  } else {
    +    use(opt.value()); // unsafe: it is clear that `opt` does *not* have a value.
    +  }
    +}
    +

    Assume a function result to be stable

    +

    The check is aware that function results might not be stable. That is, consecutive calls to the same function might return different values. For example:

    +
    void f(Foo foo) {
    +  if (foo.opt().has_value()) {
    +    use(*foo.opt()); // unsafe: it is unclear whether `foo.opt()` has a value.
    +  }
    +}
    +

    Rely on invariants of uncommon APIs

    +

    The check is unaware of invariants of uncommon APIs. For example:

    +
    void f(Foo foo) {
    +  if (foo.HasProperty("bar")) {
    +    use(*foo.GetProperty("bar")); // unsafe: it is unclear whether `foo.GetProperty("bar")` has a value.
    +  }
    +}
    +

    Check if a value exists, then pass the optional to another function

    +

    The check relies on local reasoning. The check and value access must both happen in the same function. An access is considered unsafe even if the caller of the function performing the access ensures that the optional has a value. For example:

    +
    void g(std::optional<int> opt) {
    +  use(*opt); // unsafe: it is unclear whether `opt` has a value.
     }
     
    -int *f2() noexcept {
    -  try {
    -    int *p = new int[1000]; // no warning: exception is handled
    -    // ...
    -    return p;
    -  } catch (std::bad_alloc &) {
    -    // ...
    +void f(std::optional<int> opt) {
    +  if (opt.has_value()) {
    +    g(opt);
       }
    -  // ...
    -}
    -int *f3() noexcept {
    -  int *p = new (std::nothrow) int[1000]; // no warning: "nothrow" is used
    -  // ...
    -  return p;
     }
    -

    References

    -

    clang.llvm.org

    ]]> - +

    Safe access patterns

    +

    Check if a value exists, then access the value

    +

    The check recognizes all straightforward ways for checking if a value exists and accessing the value contained in an optional object. For example:

    +
    void f(std::optional<int> opt) {
    +  if (opt.has_value()) {
    +    use(*opt);
    +  }
    +}
    +

    Check if a value exists, then access the value from a copy

    +

    The criteria that the check uses is semantic, not syntactic. It recognizes when a copy of the optional object being accessed is known to have a value. For example:

    +
    void f(std::optional<int> opt1) {
    +  if (opt1.has_value()) {
    +    std::optional<int> opt2 = opt1;
    +    use(*opt2);
    +  }
    +}
    +

    Ensure that a value exists using common macros

    +

    The check is aware of common macros like CHECK and DCHECK. Those can be used to ensure that an optional object has a value. For example:

    +
    void f(std::optional<int> opt) {
    +  DCHECK(opt.has_value());
    +  use(*opt);
    +}
    +

    Ensure that a value exists, then access the value in a correlated branch

    +

    The check is aware of correlated branches in the code and can figure out when an optional object is ensured to have a value on all execution paths that lead to an access. For example:

    +
    void f(std::optional<int> opt) {
    +  bool safe = false;
    +  if (opt.has_value() && SomeOtherCondition()) {
    +    safe = true;
    +  }
    +  // ... more code...
    +  if (safe) {
    +    use(*opt);
    +  }
    +}
    +

    Stabilize function results

    +

    Since function results are not assumed to be stable across calls, it is best to store the result of the function call in a local variable and use that variable to access the value. For example:

    +
    void f(Foo foo) {
    +  if (const auto& foo_opt = foo.opt(); foo_opt.has_value()) {
    +    use(*foo_opt);
    +  }
    +}
    +

    Do not rely on uncommon-API invariants

    +

    When uncommon APIs guarantee that an optional has contents, do not rely on it --instead, check explicitly that the optional object has a value. For example:

    +
    void f(Foo foo) {
    +  if (const auto& property = foo.GetProperty("bar")) {
    +    use(*property);
    +  }
    +}
    +

    instead of the HasProperty, GetProperty pairing we saw above.

    +

    Do not rely on caller-performed checks

    +

    If you know that all of a function's callers have checked that an optional argument has a value, either change the function to take the value directly or check the optional again in the local scope of the callee. For example:

    +
    void g(int val) {
    +  use(val);
    +}
    +
    +void f(std::optional<int> opt) {
    +  if (opt.has_value()) {
    +    g(*opt);
    +  }
    +}
    +

    and

    +
    struct S {
    +  std::optional<int> opt;
    +  int x;
    +};
    +
    +void g(const S &s) {
    +  if (s.opt.has_value() && s.x > 10) {
    +    use(*s.opt);
    +}
    +
    +void f(S s) {
    +  if (s.opt.has_value()) {
    +    g(s);
    +  }
    +}
    +

    Additional notes

    +

    Aliases created via using declarations

    +

    The check is aware of aliases of optional types that are created via using declarations. For example:

    +
    using OptionalInt = std::optional<int>;
    +
    +void f(OptionalInt opt) {
    +  use(opt.value()); // unsafe: it is unclear whether `opt` has a value.
    +}
    +

    Lambdas

    +

    The check does not currently report unsafe optional accesses in lambdas. A future version will expand the scope to lambdas, following the rules outlined above. It is best to follow the same principles when using optionals in lambdas.

    +

    Access with operator*() vs. value()

    +

    Given that value() has well-defined behavior (either throwing an exception or terminating the program), why treat it the same as operator*() which causes undefined behavior (UB)? That is, why is it considered unsafe to access an optional with value(), if it's not provably populated with a value? For that matter, why is CHECK() followed by operator*() any better than value(), given that they are semantically equivalent (on configurations that disable exceptions)?

    +

    The answer is that we assume most users do not realize the difference between value() and operator*(). Shifting to operator*() and some form of explicit value-presence check or explicit program termination has two advantages:

    +
    +
      +
    • Readability. The check, and any potential side effects like program shutdown, are very clear in the code. Separating access from checks can actually make the checks more obvious.
    • +
    • Performance. A single check can cover many or even all accesses within scope. This gives the user the best of both worlds -- the safety of a dynamic check, but without incurring redundant costs.
    • +
    +
    +

    References

    +

    clang.llvm.org

    ]]> + + INFO + + + bugprone-undefined-memory-manipulation + bugprone-undefined-memory-manipulation + + +

    clang-tidy - bugprone-undefined-memory-manipulation

    + +

    bugprone-undefined-memory-manipulation

    +

    Finds calls of memory manipulation functions memset(), memcpy() and memmove() on non-TriviallyCopyable objects resulting in undefined behavior.

    +

    Using memory manipulation functions on non-TriviallyCopyable objects can lead to a range of subtle and challenging issues in C++ code. The most immediate concern is the potential for undefined behavior, where the state of the object may become corrupted or invalid. This can manifest as crashes, data corruption, or unexpected behavior at runtime, making it challenging to identify and diagnose the root cause. Additionally, misuse of memory manipulation functions can bypass essential object-specific operations, such as constructors and destructors, leading to resource leaks or improper initialization.

    +

    For example, when using memcpy to copy std::string, pointer data is being copied, and it can result in a double free issue.

    +
    #include <cstring>
    +#include <string>
    +
    +int main() {
    +    std::string source = "Hello";
    +    std::string destination;
    +
    +    std::memcpy(&destination, &source, sizeof(std::string));
    +
    +    // Undefined behavior may occur here, during std::string destructor call.
    +    return 0;
    +}
    +

    References

    +

    clang.llvm.org

    ]]> +
    + BUG +
    + + bugprone-undelegated-constructor + bugprone-undelegated-constructor + + +

    clang-tidy - bugprone-undelegated-constructor

    + +

    bugprone-undelegated-constructor

    +

    Finds creation of temporary objects in constructors that look like a function call to another constructor of the same class.

    +

    The user most likely meant to use a delegating constructor or base class initializer.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + MINOR + BUG +
    + + bugprone-unhandled-exception-at-new + bugprone-unhandled-exception-at-new + + +

    clang-tidy - bugprone-unhandled-exception-at-new

    + +

    bugprone-unhandled-exception-at-new

    +

    Finds calls to new with missing exception handler for std::bad_alloc.

    +

    Calls to new may throw exceptions of type std::bad_alloc that should be handled. Alternatively, the nonthrowing form of new can be used. The check verifies that the exception is handled in the function that calls new.

    +

    If a nonthrowing version is used or the exception is allowed to propagate out of the function no warning is generated.

    +

    The exception handler is checked if it catches a std::bad_alloc or std::exception exception type, or all exceptions (catch-all). The check assumes that any user-defined operator new is either noexcept or may throw an exception of type std::bad_alloc (or one derived from it). Other exception class types are not taken into account.

    +
    int *f() noexcept {
    +  int *p = new int[1000]; // warning: missing exception handler for allocation failure at 'new'
    +  // ...
    +  return p;
    +}
    +
    int *f1() { // not 'noexcept'
    +  int *p = new int[1000]; // no warning: exception can be handled outside
    +                          // of this function
    +  // ...
    +  return p;
    +}
    +
    +int *f2() noexcept {
    +  try {
    +    int *p = new int[1000]; // no warning: exception is handled
    +    // ...
    +    return p;
    +  } catch (std::bad_alloc &) {
    +    // ...
    +  }
    +  // ...
    +}
    +int *f3() noexcept {
    +  int *p = new (std::nothrow) int[1000]; // no warning: "nothrow" is used
    +  // ...
    +  return p;
    +}
    +

    References

    +

    clang.llvm.org

    ]]> +
    INFO
    @@ -3346,53 +4171,257 @@ public: BUG - bugprone-unused-raii - bugprone-unused-raii + bugprone-unique-ptr-array-mismatch + bugprone-unique-ptr-array-mismatch -

    clang-tidy - bugprone-unused-raii

    +

    clang-tidy - bugprone-unique-ptr-array-mismatch

    -

    bugprone-unused-raii

    -

    Finds temporaries that look like RAII objects.

    -

    The canonical example for this is a scoped lock.

    -
    {
    -  scoped_lock(&global_mutex);
    -  critical_section();
    -}
    -

    The destructor of the scoped_lock is called before the critical_section is entered, leaving it unprotected.

    -

    We apply a number of heuristics to reduce the false positive count of this check:

    -
      -
    • Ignore code expanded from macros. Testing frameworks make heavy use of this.
    • -
    • Ignore types with trivial destructors. They are very unlikely to be RAII objects and there's no difference when they are deleted.
    • -
    • Ignore objects at the end of a compound statement (doesn't change behavior).
    • -
    • Ignore objects returned from a call.
    • -
    +

    bugprone-unique-ptr-array-mismatch

    +

    Finds initializations of C++ unique pointers to non-array type that are initialized with an array.

    +

    If a pointer std::unique_ptr<T> is initialized with a new-expression new T[] the memory is not deallocated correctly. A plain delete is used in this case to deallocate the target memory. Instead a delete[] call is needed. A std::unique_ptr<T[]> uses the correct delete operator. The check does not emit warning if an unique_ptr with user-specified deleter type is used.

    +

    The check offers replacement of unique_ptr<T> to unique_ptr<T[]> if it is used at a single variable declaration (one variable in one statement).

    +

    Example:

    +
    std::unique_ptr<Foo> x(new Foo[10]); // -> std::unique_ptr<Foo[]> x(new Foo[10]);
    +//                     ^ warning: unique pointer to non-array is initialized with array
    +std::unique_ptr<Foo> x1(new Foo), x2(new Foo[10]); // no replacement
    +//                                   ^ warning: unique pointer to non-array is initialized with array
    +
    +D d;
    +std::unique_ptr<Foo, D> x3(new Foo[10], d); // no warning (custom deleter used)
    +
    +struct S {
    +  std::unique_ptr<Foo> x(new Foo[10]); // no replacement in this case
    +  //                     ^ warning: unique pointer to non-array is initialized with array
    +};
    +

    This check partially covers the CERT C++ Coding Standard rule MEM51-CPP. Properly deallocate dynamically allocated resources However, only the std::unique_ptr case is detected by this check.

    References

    -

    clang.llvm.org

    ]]> +

    clang.llvm.org

    ]]>
    + INFO
    - bugprone-unused-return-value - bugprone-unused-return-value + bugprone-unsafe-functions + bugprone-unsafe-functions -

    clang-tidy - bugprone-unused-return-value

    +

    clang-tidy - bugprone-unsafe-functions

    -

    bugprone-unused-return-value

    -

    Warns on unused function return values. The checked functions can be configured.

    -

    Options

    -
    -

    CheckedFunctions

    -

    Semicolon-separated list of functions to check. The function is checked if the name and scope matches, with any arguments. By default the following functions are checked: std::async, std::launder, std::remove, std::remove_if, std::unique, std::unique_ptr::release, std::basic_string::empty, std::vector::empty, std::back_inserter, std::distance, std::find, std::find_if, std::inserter, std::lower_bound, std::make_pair, std::map::count, std::map::find, std::map::lower_bound, std::multimap::equal_range, std::multimap::upper_bound, std::set::count, std::set::find, std::setfill, std::setprecision, std::setw, std::upper_bound, std::vector::at, bsearch, ferror, feof, isalnum, isalpha, isblank, iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, iswalnum, iswprint, iswspace, isxdigit, memchr, memcmp, strcmp, strcoll, strncmp, strpbrk, strrchr, strspn, strstr, wcscmp, access, bind, connect, difftime, dlsym, fnmatch, getaddrinfo, getopt, htonl, htons, iconv_open, inet_addr, isascii, isatty, mmap, newlocale, openat, pathconf, pthread_equal, pthread_getspecific, pthread_mutex_trylock, readdir, readlink, recvmsg, regexec, scandir, semget, setjmp, shm_open, shmget, sigismember, strcasecmp, strsignal, ttyname

    +

    bugprone-unsafe-functions

    +

    Checks for functions that have safer, more secure replacements available, or are considered deprecated due to design flaws. The check heavily relies on the functions from the Annex K. "Bounds-checking interfaces" of C11.

    +
    +
    The check implements the following rules from the CERT C Coding Standard:
    +
    +
    +
    +

    cert-msc24-c and cert-msc33-c redirect here as aliases of this check.

    +

    Unsafe functions

    +

    If Annex K. is available, a replacement from Annex K. is suggested for the following functions:

    +

    asctime, asctime_r, bsearch, ctime, fopen, fprintf, freopen, fscanf, fwprintf, fwscanf, getenv, gets, gmtime, localtime, mbsrtowcs, mbstowcs, memcpy, memmove, memset, printf, qsort, scanf, snprintf, sprintf, sscanf, strcat, strcpy, strerror, strlen, strncat, strncpy, strtok, swprintf, swscanf, vfprintf, vfscanf, vfwprintf, vfwscanf, vprintf, vscanf, vsnprintf, vsprintf, vsscanf, vswprintf, vswscanf, vwprintf, vwscanf, wcrtomb, wcscat, wcscpy, wcslen, wcsncat, wcsncpy, wcsrtombs, wcstok, wcstombs, wctomb, wmemcpy, wmemmove, wprintf, wscanf.

    +

    If Annex K. is not available, replacements are suggested only for the following functions from the previous list:

    +
      -
    • std::async(). Not using the return value makes the call synchronous.
    • -
    • std::launder(). Not using the return value usually means that the function interface was misunderstood by the programmer. Only the returned pointer is "laundered", not the argument.
    • -
    • std::remove(), std::remove_if() and std::unique(). The returned iterator indicates the boundary between elements to keep and elements to be removed. Not using the return value means that the information about which elements to remove is lost.
    • -
    • std::unique_ptr::release(). Not using the return value can lead to resource leaks if the same pointer isn't stored anywhere else. Often, ignoring the release() return value indicates that the programmer confused the function with reset().
    • -
    • std::basic_string::empty() and std::vector::empty(). Not using the return value often indicates that the programmer confused the function with clear().
    • +
    • asctime, asctime_r, suggested replacement: strftime
    • +
    • gets, suggested replacement: fgets
    • +
    +
    +

    The following functions are always checked, regardless of Annex K availability:

    +
    +
      +
    • rewind, suggested replacement: fseek
    • +
    • setbuf, suggested replacement: setvbuf
    • +
    +
    +

    If ReportMoreUnsafeFunctions is enabled, the following functions are also checked:

    +
    +
      +
    • bcmp, suggested replacement: memcmp
    • +
    • bcopy, suggested replacement: memcpy_s if Annex K is available, or memcpy
    • +
    • bzero, suggested replacement: memset_s if Annex K is available, or memset
    • +
    • getpw, suggested replacement: getpwuid
    • +
    • vfork, suggested replacement: posix_spawn
    • +
    +
    +

    Although mentioned in the associated CERT rules, the following functions are ignored by the check:

    +

    atof, atoi, atol, atoll, tmpfile.

    +

    The availability of Annex K is determined based on the following macros:

    +
    +
      +
    • __STDC_LIB_EXT1__: feature macro, which indicates the presence of Annex K. "Bounds-checking interfaces" in the library implementation
    • +
    • __STDC_WANT_LIB_EXT1__: user-defined macro, which indicates that the user requests the functions from Annex K. to be defined.
    +
    +

    Both macros have to be defined to suggest replacement functions from Annex K. __STDC_LIB_EXT1__ is defined by the library implementation, and __STDC_WANT_LIB_EXT1__ must be defined to 1 by the user before including any system headers.

    +

    Options

    +
    +

    ReportMoreUnsafeFunctions

    +

    When true, additional functions from widely used APIs (such as POSIX) are added to the list of reported functions. See the main documentation of the check for the complete list as to what this option enables. Default is true.

    -

    cert-err33-c is an alias of this check that checks a fixed and large set of standard library functions.

    +

    Examples

    +
    #ifndef __STDC_LIB_EXT1__
    +#error "Annex K is not supported by the current standard library implementation."
    +#endif
    +
    +#define __STDC_WANT_LIB_EXT1__ 1
    +
    +#include <string.h> // Defines functions from Annex K.
    +#include <stdio.h>
    +
    +enum { BUFSIZE = 32 };
    +
    +void Unsafe(const char *Msg) {
    +  static const char Prefix[] = "Error: ";
    +  static const char Suffix[] = "\n";
    +  char Buf[BUFSIZE] = {0};
    +
    +  strcpy(Buf, Prefix); // warning: function 'strcpy' is not bounds-checking; 'strcpy_s' should be used instead.
    +  strcat(Buf, Msg);    // warning: function 'strcat' is not bounds-checking; 'strcat_s' should be used instead.
    +  strcat(Buf, Suffix); // warning: function 'strcat' is not bounds-checking; 'strcat_s' should be used instead.
    +  if (fputs(buf, stderr) < 0) {
    +    // error handling
    +    return;
    +  }
    +}
    +
    +void UsingSafeFunctions(const char *Msg) {
    +  static const char Prefix[] = "Error: ";
    +  static const char Suffix[] = "\n";
    +  char Buf[BUFSIZE] = {0};
    +
    +  if (strcpy_s(Buf, BUFSIZE, Prefix) != 0) {
    +    // error handling
    +    return;
    +  }
    +
    +  if (strcat_s(Buf, BUFSIZE, Msg) != 0) {
    +    // error handling
    +    return;
    +  }
    +
    +  if (strcat_s(Buf, BUFSIZE, Suffix) != 0) {
    +    // error handling
    +    return;
    +  }
    +
    +  if (fputs(Buf, stderr) < 0) {
    +    // error handling
    +    return;
    +  }
    +}
    +

    References

    +

    clang.llvm.org

    ]]> + + INFO + + + bugprone-unused-local-non-trivial-variable + bugprone-unused-local-non-trivial-variable + + +

    clang-tidy - bugprone-unused-local-non-trivial-variable

    +
    +

    bugprone-unused-local-non-trivial-variable

    +

    Warns when a local non trivial variable is unused within a function. The following types of variables are excluded from this check:

    +
      +
    • trivial and trivially copyable
    • +
    • references and pointers
    • +
    • exception variables in catch clauses
    • +
    • static or thread local
    • +
    • structured bindings
    • +
    +

    This check can be configured to warn on all non-trivial variables by setting IncludeTypes to .*, and excluding specific types using ExcludeTypes.

    +

    In the this example, my_lock would generate a warning that it is unused.

    +
    std::mutex my_lock;
    +// my_lock local variable is never used
    +

    In the next example, future2 would generate a warning that it is unused.

    +
    std::future<MyObject> future1;
    +std::future<MyObject> future2;
    +// ...
    +MyObject foo = future1.get();
    +// future2 is not used.
    +

    Options

    +
    +

    IncludeTypes

    +

    Semicolon-separated list of regular expressions matching types of variables to check. By default the following types are checked:

    +
      +
    • ::std::.*mutex
    • +
    • ::std::future
    • +
    • ::std::basic_string
    • +
    • ::std::basic_regex
    • +
    • ::std::basic_istringstream
    • +
    • ::std::basic_stringstream
    • +
    • ::std::bitset
    • +
    • ::std::filesystem::path
    • +
    +
    +
    +

    ExcludeTypes

    +

    A semicolon-separated list of regular expressions matching types that are excluded from the IncludeTypes matches. By default it is an empty list.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + bugprone-unused-raii + bugprone-unused-raii + + +

    clang-tidy - bugprone-unused-raii

    + +

    bugprone-unused-raii

    +

    Finds temporaries that look like RAII objects.

    +

    The canonical example for this is a scoped lock.

    +
    {
    +  scoped_lock(&global_mutex);
    +  critical_section();
    +}
    +

    The destructor of the scoped_lock is called before the critical_section is entered, leaving it unprotected.

    +

    We apply a number of heuristics to reduce the false positive count of this check:

    +
      +
    • Ignore code expanded from macros. Testing frameworks make heavy use of this.
    • +
    • Ignore types with trivial destructors. They are very unlikely to be RAII objects and there's no difference when they are deleted.
    • +
    • Ignore objects at the end of a compound statement (doesn't change behavior).
    • +
    • Ignore objects returned from a call.
    • +
    +

    References

    +

    clang.llvm.org

    ]]> +
    +
    + + bugprone-unused-return-value + bugprone-unused-return-value + + +

    clang-tidy - bugprone-unused-return-value

    + +

    bugprone-unused-return-value

    +

    Warns on unused function return values. The checked functions can be configured.

    +

    Options

    +
    +

    CheckedFunctions

    +

    Semicolon-separated list of functions to check. The function is checked if the name and scope matches, with any arguments. By default the following functions are checked: std::async, std::launder, std::remove, std::remove_if, std::unique, std::unique_ptr::release, std::basic_string::empty, std::vector::empty, std::back_inserter, std::distance, std::find, std::find_if, std::inserter, std::lower_bound, std::make_pair, std::map::count, std::map::find, std::map::lower_bound, std::multimap::equal_range, std::multimap::upper_bound, std::set::count, std::set::find, std::setfill, std::setprecision, std::setw, std::upper_bound, std::vector::at, bsearch, ferror, feof, isalnum, isalpha, isblank, iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, iswalnum, iswprint, iswspace, isxdigit, memchr, memcmp, strcmp, strcoll, strncmp, strpbrk, strrchr, strspn, strstr, wcscmp, access, bind, connect, difftime, dlsym, fnmatch, getaddrinfo, getopt, htonl, htons, iconv_open, inet_addr, isascii, isatty, mmap, newlocale, openat, pathconf, pthread_equal, pthread_getspecific, pthread_mutex_trylock, readdir, readlink, recvmsg, regexec, scandir, semget, setjmp, shm_open, shmget, sigismember, strcasecmp, strsignal, ttyname

    +
      +
    • std::async(). Not using the return value makes the call synchronous.
    • +
    • std::launder(). Not using the return value usually means that the function interface was misunderstood by the programmer. Only the returned pointer is "laundered", not the argument.
    • +
    • std::remove(), std::remove_if() and std::unique(). The returned iterator indicates the boundary between elements to keep and elements to be removed. Not using the return value means that the information about which elements to remove is lost.
    • +
    • std::unique_ptr::release(). Not using the return value can lead to resource leaks if the same pointer isn't stored anywhere else. Often, ignoring the release() return value indicates that the programmer confused the function with reset().
    • +
    • std::basic_string::empty() and std::vector::empty(). Not using the return value often indicates that the programmer confused the function with clear().
    • +
    +
    +
    +

    CheckedReturnTypes

    +

    Semicolon-separated list of function return types to check. By default the following function return types are checked: ::std::error_code, ::std::error_condition, ::std::errc, ::std::expected, ::boost::system::error_code

    +
    +
    +

    AllowCastToVoid

    +

    Controls whether casting return values to void is permitted. Default: false.

    +
    +

    cert-err33-c <../cert/err33-c> is an alias of this check that checks a fixed and large set of standard library functions.

    References

    clang.llvm.org

    ]]>
    @@ -3545,7 +4574,7 @@ struct Derived : Base {

    cert-con36-c

    -

    The cert-con36-c check is an alias, please see bugprone-spuriously-wake-up-functions for more information.

    +

    The cert-con36-c check is an alias, please see bugprone-spuriously-wake-up-functions <../bugprone/spuriously-wake-up-functions> for more information.

    References

    clang.llvm.org

    ]]> @@ -3562,7 +4591,7 @@ struct Derived : Base {

    cert-con54-cpp

    -

    The cert-con54-cpp check is an alias, please see bugprone-spuriously-wake-up-functions for more information.

    +

    The cert-con54-cpp check is an alias, please see bugprone-spuriously-wake-up-functions <../bugprone/spuriously-wake-up-functions> for more information.

    References

    clang.llvm.org

    ]]> @@ -3579,7 +4608,7 @@ struct Derived : Base {

    cert-dcl03-c

    -

    The cert-dcl03-c check is an alias, please see misc-static-assert for more information.

    +

    The cert-dcl03-c check is an alias, please see misc-static-assert <../misc/static-assert> for more information.

    References

    clang.llvm.org

    ]]> @@ -3596,7 +4625,7 @@ struct Derived : Base {

    cert-dcl16-c

    -

    The cert-dcl16-c check is an alias, please see readability-uppercase-literal-suffix for more information.

    +

    The cert-dcl16-c check is an alias, please see readability-uppercase-literal-suffix <../readability/uppercase-literal-suffix> for more information.

    References

    clang.llvm.org

    ]]> @@ -3610,6 +4639,12 @@ struct Derived : Base {

    clang-tidy - cert-dcl21-cpp

    cert-dcl21-cpp

    +
    +
    +

    Note

    +
    +

    This check is deprecated since it's no longer part of the CERT standard. It will be removed in clang-tidy version 19.

    +

    This check flags postfix operator++ and operator-- declarations if the return type is not a const object. This also warns if the return type is a reference type.

    The object returned by a postfix increment or decrement operator is supposed to be a snapshot of the object's value prior to modification. With such an implementation, any modifications made to the resulting object from calling operator++(int) would be modifying a temporary object. Thus, such an implementation of a postfix increment or decrement operator should instead return a const object, prohibiting accidental mutation of a temporary object. Similarly, it is unexpected for the postfix operator to return a reference to its previous state, and any subsequent modifications would be operating on a stale object.

    This check corresponds to the CERT C++ Coding Standard recommendation DCL21-CPP. Overloaded postfix increment and decrement operators should return a const object. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior of this check requires an account on their wiki to view.

    @@ -3628,7 +4663,7 @@ struct Derived : Base {

    cert-dcl37-c

    -

    The cert-dcl37-c check is an alias, please see bugprone-reserved-identifier for more information.

    +

    The cert-dcl37-c check is an alias, please see bugprone-reserved-identifier <../bugprone/reserved-identifier> for more information.

    References

    clang.llvm.org

    ]]> @@ -3660,7 +4695,7 @@ struct Derived : Base {

    cert-dcl51-cpp

    -

    The cert-dcl51-cpp check is an alias, please see bugprone-reserved-identifier for more information.

    +

    The cert-dcl51-cpp check is an alias, please see bugprone-reserved-identifier <../bugprone/reserved-identifier> for more information.

    References

    clang.llvm.org

    ]]> @@ -3677,7 +4712,7 @@ struct Derived : Base {

    cert-dcl54-cpp

    -

    The cert-dcl54-cpp check is an alias, please see misc-new-delete-overloads for more information.

    +

    The cert-dcl54-cpp check is an alias, please see misc-new-delete-overloads <../misc/new-delete-overloads> for more information.

    References

    clang.llvm.org

    ]]> @@ -3743,7 +4778,7 @@ namespace std {

    cert-dcl59-cpp

    -

    The cert-dcl59-cpp check is an alias, please see google-build-namespaces for more information.

    +

    The cert-dcl59-cpp check is an alias, please see google-build-namespaces <../google/build-namespaces> for more information.

    References

    clang.llvm.org

    ]]> @@ -3775,7 +4810,7 @@ namespace std {

    cert-err09-cpp

    -

    The cert-err09-cpp check is an alias, please see misc-throw-by-value-catch-by-reference for more information.

    +

    The cert-err09-cpp check is an alias, please see misc-throw-by-value-catch-by-reference <../misc/throw-by-value-catch-by-reference> for more information.

    This check corresponds to the CERT C++ Coding Standard recommendation ERR09-CPP. Throw anonymous temporaries. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior of this check requires an account on their wiki to view.

    References

    clang.llvm.org

    ]]> @@ -3971,7 +5006,8 @@ namespace std {
  • wscanf()
  • wscanf_s()
  • -

    This check is an alias of check bugprone-unused-return-value with a fixed set of functions.

    +

    This check is an alias of check bugprone-unused-return-value <../bugprone/unused-return-value> with a fixed set of functions.

    +

    Suppressing issues by casting to void is enabled by default and can be disabled by setting AllowCastToVoid option to false.

    The check corresponds to a part of CERT C Coding Standard rule ERR33-C. Detect and handle standard library errors. The list of checked functions is taken from the rule, with following exception:

    • The check can not differentiate if a function is called with NULL argument. Therefore the following functions are not checked: mblen, mbrlen, mbrtowc, mbtowc, wctomb, wctomb_s
    • @@ -4064,7 +5100,7 @@ void func(const char *buff) {

      cert-err61-cpp

      -

      The cert-err61-cpp check is an alias, please see misc-throw-by-value-catch-by-reference for more information.

      +

      The cert-err61-cpp check is an alias, please see misc-throw-by-value-catch-by-reference <../misc/throw-by-value-catch-by-reference> for more information.

      References

      clang.llvm.org

      ]]> @@ -4078,7 +5114,7 @@ void func(const char *buff) {

      cert-exp42-c

      -

      The cert-exp42-c check is an alias, please see bugprone-suspicious-memory-comparison for more information.

      +

      The cert-exp42-c check is an alias, please see bugprone-suspicious-memory-comparison <../bugprone/suspicious-memory-comparison> for more information.

      References

      clang.llvm.org

      ]]> @@ -4095,7 +5131,7 @@ void func(const char *buff) {

      cert-fio38-c

      -

      The cert-fio38-c check is an alias, please see misc-non-copyable-objects for more information.

      +

      The cert-fio38-c check is an alias, please see misc-non-copyable-objects <../misc/non-copyable-objects> for more information.

      References

      clang.llvm.org

      ]]> @@ -4122,7 +5158,7 @@ void func(const char *buff) {

      cert-flp37-c

      -

      The cert-flp37-c check is an alias, please see bugprone-suspicious-memory-comparison for more information.

      +

      The cert-flp37-c check is an alias, please see bugprone-suspicious-memory-comparison <../bugprone/suspicious-memory-comparison> for more information.

      References

      clang.llvm.org

      ]]> @@ -4143,6 +5179,23 @@ void func(const char *buff) { MINOR + + cert-msc24-c + cert-msc24-c + + +

      clang-tidy - cert-msc24-c

      + +
      + +
      +

      cert-msc24-c

      +

      The cert-msc24-c check is an alias, please see bugprone-unsafe-functions <../bugprone/unsafe-functions> for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      cert-msc30-c cert-msc30-c @@ -4154,7 +5207,7 @@ void func(const char *buff) {

      cert-msc30-c

      -

      The cert-msc30-c check is an alias, please see cert-msc50-cpp for more information.

      +

      The cert-msc30-c check is an alias, please see cert-msc50-cpp <../cert/msc50-cpp> for more information.

      References

      clang.llvm.org

      ]]> @@ -4171,12 +5224,29 @@ void func(const char *buff) {

      cert-msc32-c

      -

      The cert-msc32-c check is an alias, please see cert-msc51-cpp for more information.

      +

      The cert-msc32-c check is an alias, please see cert-msc51-cpp <../cert/msc51-cpp> for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + cert-msc33-c + cert-msc33-c + + +

      clang-tidy - cert-msc33-c

      + +
      + +
      +

      cert-msc33-c

      +

      The cert-msc33-c check is an alias, please see bugprone-unsafe-functions <../bugprone/unsafe-functions> for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      cert-msc50-cpp cert-msc50-cpp @@ -4223,6 +5293,23 @@ void func(const char *buff) { INFO + + cert-msc54-cpp + cert-msc54-cpp + + +

      clang-tidy - cert-msc54-cpp

      + +
      + +
      +

      cert-msc54-cpp

      +

      The cert-msc54-cpp check is an alias, please see bugprone-signal-handler <../bugprone/signal-handler> for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      cert-oop11-cpp cert-oop11-cpp @@ -4234,7 +5321,7 @@ void func(const char *buff) {

      cert-oop11-cpp

      -

      The cert-oop11-cpp check is an alias, please see performance-move-constructor-init for more information.

      +

      The cert-oop11-cpp check is an alias, please see performance-move-constructor-init <../performance/move-constructor-init> for more information.

      This check corresponds to the CERT C++ Coding Standard recommendation OOP11-CPP. Do not copy-initialize members or base classes from a move constructor. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior of this check requires an account on their wiki to view.

      References

      clang.llvm.org

      ]]> @@ -4252,7 +5339,7 @@ void func(const char *buff) {

      cert-oop54-cpp

      -

      The cert-oop54-cpp check is an alias, please see bugprone-unhandled-self-assignment for more information.

      +

      The cert-oop54-cpp check is an alias, please see bugprone-unhandled-self-assignment <../bugprone/unhandled-self-assignment> for more information.

      References

      clang.llvm.org

      ]]> @@ -4314,7 +5401,7 @@ void func(const char *buff) {

      cert-pos44-c

      -

      The cert-pos44-c check is an alias, please see bugprone-bad-signal-to-kill-thread for more information.

      +

      The cert-pos44-c check is an alias, please see bugprone-bad-signal-to-kill-thread <../bugprone/bad-signal-to-kill-thread> for more information.

      References

      clang.llvm.org

      ]]> @@ -4331,7 +5418,7 @@ void func(const char *buff) {

      cert-pos47-c

      -

      The cert-pos47-c check is an alias, please see concurrency-thread-canceltype-asynchronous for more information.

      +

      The cert-pos47-c check is an alias, please see concurrency-thread-canceltype-asynchronous <../concurrency/thread-canceltype-asynchronous> for more information.

      References

      clang.llvm.org

      ]]> @@ -4348,7 +5435,7 @@ void func(const char *buff) {

      cert-sig30-c

      -

      The cert-sig30-c check is an alias, please see bugprone-signal-handler for more information.

      +

      The cert-sig30-c check is an alias, please see bugprone-signal-handler <../bugprone/signal-handler> for more information.

      References

      clang.llvm.org

      ]]> @@ -4365,12 +5452,30 @@ void func(const char *buff) {

      cert-str34-c

      -

      The cert-str34-c check is an alias, please see bugprone-signed-char-misuse for more information.

      +

      The cert-str34-c check is an alias, please see bugprone-signed-char-misuse <../bugprone/signed-char-misuse> for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + clang-analyzer-core.BitwiseShift + clang-analyzer-core.BitwiseShift + + +

      clang-tidy - clang-analyzer-core.BitwiseShift

      + +
      + +
      +

      clang-analyzer-core.BitwiseShift

      +

      Finds cases where bitwise shift operation causes undefined behaviour.

      +

      The clang-analyzer-core.BitwiseShift check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-core.CallAndMessage clang-analyzer-core.CallAndMessage @@ -4382,7 +5487,8 @@ void func(const char *buff) {

      clang-analyzer-core.CallAndMessage

      -

      The clang-analyzer-core.CallAndMessage check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers).

      +

      The clang-analyzer-core.CallAndMessage check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4399,7 +5505,8 @@ void func(const char *buff) {

      clang-analyzer-core.DivideZero

      -

      The clang-analyzer-core.DivideZero check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for division by zero.

      +

      The clang-analyzer-core.DivideZero check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4430,7 +5537,8 @@ void func(const char *buff) {

      clang-analyzer-core.NonNullParamChecker

      -

      The clang-analyzer-core.NonNullParamChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for null pointers passed as arguments to a function whose arguments are references or marked with the 'nonnull' attribute.

      +

      The clang-analyzer-core.NonNullParamChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4447,7 +5555,8 @@ void func(const char *buff) {

      clang-analyzer-core.NullDereference

      -

      The clang-analyzer-core.NullDereference check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for dereferences of null pointers.

      +

      The clang-analyzer-core.NullDereference check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4464,7 +5573,8 @@ void func(const char *buff) {

      clang-analyzer-core.StackAddressEscape

      -

      The clang-analyzer-core.StackAddressEscape check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check that addresses to stack memory do not escape the function.

      +

      The clang-analyzer-core.StackAddressEscape check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4481,7 +5591,8 @@ void func(const char *buff) {

      clang-analyzer-core.UndefinedBinaryOperatorResult

      -

      The clang-analyzer-core.UndefinedBinaryOperatorResult check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for undefined results of binary operators.

      +

      The clang-analyzer-core.UndefinedBinaryOperatorResult check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4498,7 +5609,8 @@ void func(const char *buff) {

      clang-analyzer-core.uninitialized.ArraySubscript

      -

      The clang-analyzer-core.uninitialized.ArraySubscript check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for uninitialized values used as array subscripts.

      +

      The clang-analyzer-core.uninitialized.ArraySubscript check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4515,7 +5627,8 @@ void func(const char *buff) {

      clang-analyzer-core.uninitialized.Assign

      -

      The clang-analyzer-core.uninitialized.Assign check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for assigning uninitialized values.

      +

      The clang-analyzer-core.uninitialized.Assign check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4532,7 +5645,8 @@ void func(const char *buff) {

      clang-analyzer-core.uninitialized.Branch

      -

      The clang-analyzer-core.uninitialized.Branch check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for uninitialized values used as branch conditions.

      +

      The clang-analyzer-core.uninitialized.Branch check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4544,14 +5658,36 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-core.uninitialized.CapturedBlockVariable

      + +
      +

      clang-analyzer-core.uninitialized.CapturedBlockVariable

      -

      Check for blocks that capture uninitialized values

      +

      Check for blocks that capture uninitialized values.

      +

      The clang-analyzer-core.uninitialized.CapturedBlockVariable check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      INFO
      + + clang-analyzer-core.uninitialized.NewArraySize + clang-analyzer-core.uninitialized.NewArraySize + + +

      clang-tidy - clang-analyzer-core.uninitialized.NewArraySize

      + +
      + +
      +

      clang-analyzer-core.uninitialized.NewArraySize

      +

      Check if the size of the array in a new[] expression is undefined.

      +

      The clang-analyzer-core.uninitialized.NewArraySize check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-core.uninitialized.UndefReturn clang-analyzer-core.uninitialized.UndefReturn @@ -4563,7 +5699,8 @@ void func(const char *buff) {

      clang-analyzer-core.uninitialized.UndefReturn

      -

      The clang-analyzer-core.uninitialized.UndefReturn check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for uninitialized values being returned to the caller.

      +

      The clang-analyzer-core.uninitialized.UndefReturn check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4580,7 +5717,8 @@ void func(const char *buff) {

      clang-analyzer-core.VLASize

      -

      The clang-analyzer-core.VLASize check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for declarations of VLA of undefined or zero size.

      +

      The clang-analyzer-core.VLASize check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4592,9 +5730,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-cplusplus.InnerPointer

      + +
      +

      clang-analyzer-cplusplus.InnerPointer

      -

      Check for inner pointers of C++ containers used after re/deallocation

      +

      Check for inner pointers of C++ containers used after re/deallocation.

      +

      The clang-analyzer-cplusplus.InnerPointer check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -4606,12 +5748,10 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-cplusplus.Move

      - -
      -

      clang-analyzer-cplusplus.Move

      -

      The clang-analyzer-cplusplus.Move check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Find use-after-move bugs in C++.

      +

      The clang-analyzer-cplusplus.Move check is an alias of Clang Static Analyzer cplusplus.Move.

      References

      clang.llvm.org

      ]]>
      @@ -4628,7 +5768,8 @@ void func(const char *buff) {

      clang-analyzer-cplusplus.NewDelete

      -

      The clang-analyzer-cplusplus.NewDelete check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for double-free and use-after-free problems. Traces memory managed by new/delete.

      +

      The clang-analyzer-cplusplus.NewDelete check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4645,12 +5786,64 @@ void func(const char *buff) {

      clang-analyzer-cplusplus.NewDeleteLeaks

      -

      The clang-analyzer-cplusplus.NewDeleteLeaks check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for memory leaks. Traces memory managed by new/delete.

      +

      The clang-analyzer-cplusplus.NewDeleteLeaks check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + clang-analyzer-cplusplus.PlacementNew + clang-analyzer-cplusplus.PlacementNew + + +

      clang-tidy - clang-analyzer-cplusplus.PlacementNew

      + +
      + +
      +

      clang-analyzer-cplusplus.PlacementNew

      +

      Check if default placement new is provided with pointers to sufficient storage capacity.

      +

      The clang-analyzer-cplusplus.PlacementNew check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      + + clang-analyzer-cplusplus.PureVirtualCall + clang-analyzer-cplusplus.PureVirtualCall + + +

      clang-tidy - clang-analyzer-cplusplus.PureVirtualCall

      + +

      clang-analyzer-cplusplus.PureVirtualCall

      +

      Check pure virtual function calls during construction/destruction.

      +

      The clang-analyzer-cplusplus.PureVirtualCall check is an alias of Clang Static Analyzer cplusplus.PureVirtualCall.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      + + clang-analyzer-cplusplus.StringChecker + clang-analyzer-cplusplus.StringChecker + + +

      clang-tidy - clang-analyzer-cplusplus.StringChecker

      + +
      + +
      +

      clang-analyzer-cplusplus.StringChecker

      +

      Checks C++ std::string bugs.

      +

      The clang-analyzer-cplusplus.StringChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-deadcode.DeadStores clang-analyzer-deadcode.DeadStores @@ -4662,12 +5855,31 @@ void func(const char *buff) {

      clang-analyzer-deadcode.DeadStores

      -

      The clang-analyzer-deadcode.DeadStores check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for values stored to variables that are never read afterwards.

      +

      The clang-analyzer-deadcode.DeadStores check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + clang-analyzer-fuchsia.HandleChecker + clang-analyzer-fuchsia.HandleChecker + + +

      clang-tidy - clang-analyzer-fuchsia.HandleChecker

      + +
      + +
      +

      clang-analyzer-fuchsia.HandleChecker

      +

      A Checker that detect leaks related to Fuchsia handles.

      +

      The clang-analyzer-fuchsia.HandleChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-nullability.NullableDereferenced clang-analyzer-nullability.NullableDereferenced @@ -4679,7 +5891,8 @@ void func(const char *buff) {

      clang-analyzer-nullability.NullableDereferenced

      -

      The clang-analyzer-nullability.NullableDereferenced check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warns when a nullable pointer is dereferenced.

      +

      The clang-analyzer-nullability.NullableDereferenced check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4696,7 +5909,8 @@ void func(const char *buff) {

      clang-analyzer-nullability.NullablePassedToNonnull

      -

      The clang-analyzer-nullability.NullablePassedToNonnull check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warns when a nullable pointer is passed to a pointer which has a _Nonnull type.

      +

      The clang-analyzer-nullability.NullablePassedToNonnull check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4708,9 +5922,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-nullability.NullableReturnedFromNonnull

      + +
      +

      clang-analyzer-nullability.NullableReturnedFromNonnull

      Warns when a nullable pointer is returned from a function that has _Nonnull return type.

      +

      The clang-analyzer-nullability.NullableReturnedFromNonnull check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -4727,7 +5945,8 @@ void func(const char *buff) {

      clang-analyzer-nullability.NullPassedToNonnull

      -

      The clang-analyzer-nullability.NullPassedToNonnull check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warns when a null pointer is passed to a pointer which has a _Nonnull type.

      +

      The clang-analyzer-nullability.NullPassedToNonnull check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4744,12 +5963,31 @@ void func(const char *buff) {

      clang-analyzer-nullability.NullReturnedFromNonnull

      -

      The clang-analyzer-nullability.NullReturnedFromNonnull check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warns when a null pointer is returned from a function that has _Nonnull return type.

      +

      The clang-analyzer-nullability.NullReturnedFromNonnull check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + clang-analyzer-optin.core.EnumCastOutOfRange + clang-analyzer-optin.core.EnumCastOutOfRange + + +

      clang-tidy - clang-analyzer-optin.core.EnumCastOutOfRange

      + +
      + +
      +

      clang-analyzer-optin.core.EnumCastOutOfRange

      +

      Check integer to enumeration casts for out of range values.

      +

      The clang-analyzer-optin.core.EnumCastOutOfRange check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-optin.cplusplus.UninitializedObject clang-analyzer-optin.cplusplus.UninitializedObject @@ -4761,7 +5999,8 @@ void func(const char *buff) {

      clang-analyzer-optin.cplusplus.UninitializedObject

      -

      The clang-analyzer-optin.cplusplus.UninitializedObject check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Reports uninitialized fields after object construction.

      +

      The clang-analyzer-optin.cplusplus.UninitializedObject check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4778,7 +6017,8 @@ void func(const char *buff) {

      clang-analyzer-optin.cplusplus.VirtualCall

      -

      The clang-analyzer-optin.cplusplus.VirtualCall check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check virtual function calls during construction/destruction.

      +

      The clang-analyzer-optin.cplusplus.VirtualCall check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4795,7 +6035,8 @@ void func(const char *buff) {

      clang-analyzer-optin.mpi.MPI-Checker

      -

      The clang-analyzer-optin.mpi.MPI-Checker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Checks MPI code.

      +

      The clang-analyzer-optin.mpi.MPI-Checker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4812,7 +6053,8 @@ void func(const char *buff) {

      clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker

      -

      The clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check that NSLocalizedString macros include a comment for context.

      +

      The clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4829,7 +6071,8 @@ void func(const char *buff) {

      clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker

      -

      The clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warns about uses of non-localized NSStrings passed to UI methods expecting localized NSStrings.

      +

      The clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4843,7 +6086,8 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-optin.osx.OSObjectCStyleCast

      clang-analyzer-optin.osx.OSObjectCStyleCast

      -

      Checker for C-style casts of OSObjects

      +

      Checker for C-style casts of OSObjects.

      +

      The clang-analyzer-optin.osx.OSObjectCStyleCast check is an alias of Clang Static Analyzer optin.osx.OSObjectCStyleCast.

      References

      clang.llvm.org

      ]]> @@ -4855,9 +6099,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-optin.performance.GCDAntipattern

      + +
      +

      clang-analyzer-optin.performance.GCDAntipattern

      -

      Check for performance anti-patterns when using Grand Central Dispatch

      +

      Check for performance anti-patterns when using Grand Central Dispatch.

      +

      The clang-analyzer-optin.performance.GCDAntipattern check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -4869,9 +6117,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-optin.performance.Padding

      + +
      +

      clang-analyzer-optin.performance.Padding

      Check for excessively padded structs.

      +

      The clang-analyzer-optin.performance.Padding check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -4883,9 +6135,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-optin.portability.UnixAPI

      + +
      +

      clang-analyzer-optin.portability.UnixAPI

      -

      Finds implementation-defined behavior in UNIX/Posix functions

      +

      Finds implementation-defined behavior in UNIX/Posix functions.

      +

      The clang-analyzer-optin.portability.UnixAPI check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -4902,7 +6158,8 @@ void func(const char *buff) {

      clang-analyzer-osx.API

      -

      The clang-analyzer-osx.API check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for proper uses of various Apple APIs.

      +

      The clang-analyzer-osx.API check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4919,7 +6176,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.AtSync

      -

      The clang-analyzer-osx.cocoa.AtSync check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for nil pointers used as mutexes for @synchronized.

      +

      The clang-analyzer-osx.cocoa.AtSync check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4931,9 +6189,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.cocoa.AutoreleaseWrite

      + +
      +

      clang-analyzer-osx.cocoa.AutoreleaseWrite

      -

      Warn about potentially crashing writes to autoreleasing objects from different autoreleasing pools in Objective-C

      +

      Warn about potentially crashing writes to autoreleasing objects from different autoreleasing pools in Objective-C.

      +

      The clang-analyzer-osx.cocoa.AutoreleaseWrite check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -4950,7 +6212,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.ClassRelease

      -

      The clang-analyzer-osx.cocoa.ClassRelease check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for sending 'retain', 'release', or 'autorelease' directly to a Class.

      +

      The clang-analyzer-osx.cocoa.ClassRelease check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4967,7 +6230,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.Dealloc

      -

      The clang-analyzer-osx.cocoa.Dealloc check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn about Objective-C classes that lack a correct implementation of -dealloc.

      +

      The clang-analyzer-osx.cocoa.Dealloc check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4984,7 +6248,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.IncompatibleMethodTypes

      -

      The clang-analyzer-osx.cocoa.IncompatibleMethodTypes check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn about Objective-C method signatures with type incompatibilities.

      +

      The clang-analyzer-osx.cocoa.IncompatibleMethodTypes check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -4996,9 +6261,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.cocoa.Loops

      + +
      +

      clang-analyzer-osx.cocoa.Loops

      -

      Improved modeling of loops using Cocoa collection types

      +

      Improved modeling of loops using Cocoa collection types.

      +

      The clang-analyzer-osx.cocoa.Loops check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -5010,9 +6279,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.cocoa.MissingSuperCall

      + +
      +

      clang-analyzer-osx.cocoa.MissingSuperCall

      -

      Warn about Objective-C methods that lack a necessary call to super

      +

      Warn about Objective-C methods that lack a necessary call to super.

      +

      The clang-analyzer-osx.cocoa.MissingSuperCall check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -5029,7 +6302,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.NilArg

      -

      The clang-analyzer-osx.cocoa.NilArg check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for prohibited nil arguments to ObjC method calls.

      +

      The clang-analyzer-osx.cocoa.NilArg check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5041,9 +6315,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.cocoa.NonNilReturnValue

      + +
      +

      clang-analyzer-osx.cocoa.NonNilReturnValue

      -

      Model the APIs that are guaranteed to return a non-nil value

      +

      Model the APIs that are guaranteed to return a non-nil value.

      +

      The clang-analyzer-osx.cocoa.NonNilReturnValue check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -5060,7 +6338,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.NSAutoreleasePool

      -

      The clang-analyzer-osx.cocoa.NSAutoreleasePool check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode.

      +

      The clang-analyzer-osx.cocoa.NSAutoreleasePool check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5077,7 +6356,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.NSError

      -

      The clang-analyzer-osx.cocoa.NSError check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check usage of NSError** parameters.

      +

      The clang-analyzer-osx.cocoa.NSError check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5094,7 +6374,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.ObjCGenerics

      -

      The clang-analyzer-osx.cocoa.ObjCGenerics check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for type errors when using Objective-C generics.

      +

      The clang-analyzer-osx.cocoa.ObjCGenerics check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5111,7 +6392,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.RetainCount

      -

      The clang-analyzer-osx.cocoa.RetainCount check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for leaks and improper reference count management.

      +

      The clang-analyzer-osx.cocoa.RetainCount check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5123,9 +6405,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak

      + +
      +

      clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak

      -

      Check for leaked memory in autorelease pools that will never be drained

      +

      Check for leaked memory in autorelease pools that will never be drained.

      +

      The clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -5142,7 +6428,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.SelfInit

      -

      The clang-analyzer-osx.cocoa.SelfInit check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check that 'self' is properly initialized inside an initializer method.

      +

      The clang-analyzer-osx.cocoa.SelfInit check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5159,7 +6446,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.SuperDealloc

      -

      The clang-analyzer-osx.cocoa.SuperDealloc check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn about improper use of '[super dealloc]' in Objective-C.

      +

      The clang-analyzer-osx.cocoa.SuperDealloc check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5176,7 +6464,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.UnusedIvars

      -

      The clang-analyzer-osx.cocoa.UnusedIvars check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn about private ivars that are never used.

      +

      The clang-analyzer-osx.cocoa.UnusedIvars check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5193,7 +6482,8 @@ void func(const char *buff) {

      clang-analyzer-osx.cocoa.VariadicMethodTypes

      -

      The clang-analyzer-osx.cocoa.VariadicMethodTypes check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for passing non-Objective-C types to variadic collection initialization methods that expect only Objective-C types.

      +

      The clang-analyzer-osx.cocoa.VariadicMethodTypes check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5210,7 +6500,8 @@ void func(const char *buff) {

      clang-analyzer-osx.coreFoundation.CFError

      -

      The clang-analyzer-osx.coreFoundation.CFError check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check usage of CFErrorRef* parameters.

      +

      The clang-analyzer-osx.coreFoundation.CFError check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5227,7 +6518,8 @@ void func(const char *buff) {

      clang-analyzer-osx.coreFoundation.CFNumber

      -

      The clang-analyzer-osx.coreFoundation.CFNumber check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for proper uses of CFNumber APIs.

      +

      The clang-analyzer-osx.coreFoundation.CFNumber check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5244,7 +6536,8 @@ void func(const char *buff) {

      clang-analyzer-osx.coreFoundation.CFRetainRelease

      -

      The clang-analyzer-osx.coreFoundation.CFRetainRelease check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for null arguments to CFRetain/CFRelease/CFMakeCollectable.

      +

      The clang-analyzer-osx.coreFoundation.CFRetainRelease check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5261,7 +6554,8 @@ void func(const char *buff) {

      clang-analyzer-osx.coreFoundation.containers.OutOfBounds

      -

      The clang-analyzer-osx.coreFoundation.containers.OutOfBounds check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Checks for index out-of-bounds when using 'CFArray' API.

      +

      The clang-analyzer-osx.coreFoundation.containers.OutOfBounds check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5278,7 +6572,8 @@ void func(const char *buff) {

      clang-analyzer-osx.coreFoundation.containers.PointerSizedValues

      -

      The clang-analyzer-osx.coreFoundation.containers.PointerSizedValues check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with non-pointer-size values.

      +

      The clang-analyzer-osx.coreFoundation.containers.PointerSizedValues check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5292,7 +6587,8 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.MIG

      clang-analyzer-osx.MIG

      -

      Find violations of the Mach Interface Generator calling convention

      +

      Find violations of the Mach Interface Generator calling convention.

      +

      The clang-analyzer-osx.MIG check is an alias of Clang Static Analyzer osx.MIG.

      References

      clang.llvm.org

      ]]> @@ -5304,9 +6600,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.NumberObjectConversion

      + +
      +

      clang-analyzer-osx.NumberObjectConversion

      -

      Check for erroneous conversions of objects representing numbers into numbers

      +

      Check for erroneous conversions of objects representing numbers into numbers.

      +

      The clang-analyzer-osx.NumberObjectConversion check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -5318,9 +6618,13 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.ObjCProperty

      + +
      +

      clang-analyzer-osx.ObjCProperty

      -

      Check for proper uses of Objective-C properties

      +

      Check for proper uses of Objective-C properties.

      +

      The clang-analyzer-osx.ObjCProperty check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]>
      @@ -5334,7 +6638,8 @@ void func(const char *buff) {

      clang-tidy - clang-analyzer-osx.OSObjectRetainCount

      clang-analyzer-osx.OSObjectRetainCount

      -

      Check for leaks and improper reference count management for OSObject

      +

      Check for leaks and improper reference count management for OSObject.

      +

      The clang-analyzer-osx.OSObjectRetainCount check is an alias of Clang Static Analyzer osx.OSObjectRetainCount.

      References

      clang.llvm.org

      ]]> @@ -5351,12 +6656,31 @@ void func(const char *buff) {

      clang-analyzer-osx.SecKeychainAPI

      -

      The clang-analyzer-osx.SecKeychainAPI check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for proper uses of Secure Keychain APIs.

      +

      The clang-analyzer-osx.SecKeychainAPI check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + clang-analyzer-security.cert.env.InvalidPtr + clang-analyzer-security.cert.env.InvalidPtr + + +

      clang-tidy - clang-analyzer-security.cert.env.InvalidPtr

      + +
      + +
      +

      clang-analyzer-security.cert.env.InvalidPtr

      +

      Finds usages of possibly invalidated pointers.

      +

      The clang-analyzer-security.cert.env.InvalidPtr check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-security.FloatLoopCounter clang-analyzer-security.FloatLoopCounter @@ -5368,7 +6692,8 @@ void func(const char *buff) {

      clang-analyzer-security.FloatLoopCounter

      -

      The clang-analyzer-security.FloatLoopCounter check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on using a floating point value as a loop counter (CERT: FLP30-C, FLP30-CPP).

      +

      The clang-analyzer-security.FloatLoopCounter check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5385,7 +6710,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.bcmp

      -

      The clang-analyzer-security.insecureAPI.bcmp check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'bcmp' function.

      +

      The clang-analyzer-security.insecureAPI.bcmp check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5402,7 +6728,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.bcopy

      -

      The clang-analyzer-security.insecureAPI.bcopy check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'bcopy' function.

      +

      The clang-analyzer-security.insecureAPI.bcopy check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5419,12 +6746,28 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.bzero

      -

      The clang-analyzer-security.insecureAPI.bzero check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'bzero' function.

      +

      The clang-analyzer-security.insecureAPI.bzero check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + clang-analyzer-security.insecureAPI.decodeValueOfObjCType + clang-analyzer-security.insecureAPI.decodeValueOfObjCType + + +

      clang-tidy - clang-analyzer-security.insecureAPI.decodeValueOfObjCType

      + +

      clang-analyzer-security.insecureAPI.decodeValueOfObjCType

      +

      Warn on uses of the '-decodeValueOfObjCType:at:' method.

      +

      The clang-analyzer-security.insecureAPI.decodeValueOfObjCType check is an alias of Clang Static Analyzer security.insecureAPI.decodeValueOfObjCType.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling @@ -5436,7 +6779,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling

      -

      The clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of unsecure or deprecated buffer manipulating functions.

      +

      The clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5453,7 +6797,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.getpw

      -

      The clang-analyzer-security.insecureAPI.getpw check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'getpw' function.

      +

      The clang-analyzer-security.insecureAPI.getpw check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5470,7 +6815,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.gets

      -

      The clang-analyzer-security.insecureAPI.gets check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'gets' function.

      +

      The clang-analyzer-security.insecureAPI.gets check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5487,7 +6833,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.mkstemp

      -

      The clang-analyzer-security.insecureAPI.mkstemp check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn when 'mkstemp' is passed fewer than 6 X's in the format string.

      +

      The clang-analyzer-security.insecureAPI.mkstemp check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5504,7 +6851,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.mktemp

      -

      The clang-analyzer-security.insecureAPI.mktemp check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'mktemp' function.

      +

      The clang-analyzer-security.insecureAPI.mktemp check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5521,7 +6869,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.rand

      -

      The clang-analyzer-security.insecureAPI.rand check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'rand', 'random', and related functions.

      +

      The clang-analyzer-security.insecureAPI.rand check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5538,7 +6887,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.strcpy

      -

      The clang-analyzer-security.insecureAPI.strcpy check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'strcpy' and 'strcat' functions.

      +

      The clang-analyzer-security.insecureAPI.strcpy check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5555,7 +6905,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.UncheckedReturn

      -

      The clang-analyzer-security.insecureAPI.UncheckedReturn check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of functions whose return values must be always checked.

      +

      The clang-analyzer-security.insecureAPI.UncheckedReturn check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5572,7 +6923,8 @@ void func(const char *buff) {

      clang-analyzer-security.insecureAPI.vfork

      -

      The clang-analyzer-security.insecureAPI.vfork check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Warn on uses of the 'vfork' function.

      +

      The clang-analyzer-security.insecureAPI.vfork check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5589,7 +6941,8 @@ void func(const char *buff) {

      clang-analyzer-unix.API

      -

      The clang-analyzer-unix.API check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check calls to various UNIX/Posix functions.

      +

      The clang-analyzer-unix.API check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5606,7 +6959,8 @@ void func(const char *buff) {

      clang-analyzer-unix.cstring.BadSizeArg

      -

      The clang-analyzer-unix.cstring.BadSizeArg check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check the size argument passed into C string functions for common erroneous patterns.

      +

      The clang-analyzer-unix.cstring.BadSizeArg check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5623,12 +6977,31 @@ void func(const char *buff) {

      clang-analyzer-unix.cstring.NullArg

      -

      The clang-analyzer-unix.cstring.NullArg check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for null pointers being passed as arguments to C string functions.

      +

      The clang-analyzer-unix.cstring.NullArg check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + clang-analyzer-unix.Errno + clang-analyzer-unix.Errno + + +

      clang-tidy - clang-analyzer-unix.Errno

      + +
      + +
      +

      clang-analyzer-unix.Errno

      +

      Check for improper use of 'errno'.

      +

      The clang-analyzer-unix.Errno check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-unix.Malloc clang-analyzer-unix.Malloc @@ -5640,7 +7013,8 @@ void func(const char *buff) {

      clang-analyzer-unix.Malloc

      -

      The clang-analyzer-unix.Malloc check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for memory leaks, double free, and use-after-free problems. Traces memory managed by malloc()/free().

      +

      The clang-analyzer-unix.Malloc check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5657,7 +7031,8 @@ void func(const char *buff) {

      clang-analyzer-unix.MallocSizeof

      -

      The clang-analyzer-unix.MallocSizeof check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for dubious malloc arguments involving sizeof.

      +

      The clang-analyzer-unix.MallocSizeof check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5674,12 +7049,31 @@ void func(const char *buff) {

      clang-analyzer-unix.MismatchedDeallocator

      -

      The clang-analyzer-unix.MismatchedDeallocator check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for mismatched deallocators.

      +

      The clang-analyzer-unix.MismatchedDeallocator check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> INFO
      + + clang-analyzer-unix.StdCLibraryFunctions + clang-analyzer-unix.StdCLibraryFunctions + + +

      clang-tidy - clang-analyzer-unix.StdCLibraryFunctions

      + +
      + +
      +

      clang-analyzer-unix.StdCLibraryFunctions

      +

      Check for invalid arguments of C standard library functions, and apply relations between arguments and return value.

      +

      The clang-analyzer-unix.StdCLibraryFunctions check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      clang-analyzer-unix.Vfork clang-analyzer-unix.Vfork @@ -5691,7 +7085,8 @@ void func(const char *buff) {

      clang-analyzer-unix.Vfork

      -

      The clang-analyzer-unix.Vfork check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      Check for proper usage of vfork.

      +

      The clang-analyzer-unix.Vfork check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      References

      clang.llvm.org

      ]]> @@ -5706,6 +7101,7 @@ void func(const char *buff) {

      clang-analyzer-valist.CopyToSelf

      Check for va_lists which are copied onto itself.

      +

      The clang-analyzer-valist.CopyToSelf check is an alias of Clang Static Analyzer valist.CopyToSelf.

      References

      clang.llvm.org

      ]]> @@ -5720,6 +7116,7 @@ void func(const char *buff) {

      clang-analyzer-valist.Uninitialized

      Check for usages of uninitialized (or already released) va_lists.

      +

      The clang-analyzer-valist.Uninitialized check is an alias of Clang Static Analyzer valist.Uninitialized.

      References

      clang.llvm.org

      ]]> @@ -5734,24 +7131,79 @@ void func(const char *buff) {

      clang-analyzer-valist.Unterminated

      Check for va_lists which are not released by a va_end call.

      +

      The clang-analyzer-valist.Unterminated check is an alias of Clang Static Analyzer valist.Unterminated.

      References

      clang.llvm.org

      ]]> INFO
      - concurrency-mt-unsafe - concurrency-mt-unsafe + clang-analyzer-webkit.NoUncountedMemberChecker + clang-analyzer-webkit.NoUncountedMemberChecker -

      clang-tidy - concurrency-mt-unsafe

      +

      clang-tidy - clang-analyzer-webkit.NoUncountedMemberChecker

      -

      concurrency-mt-unsafe

      -

      Checks for some thread-unsafe functions against a black list of known-to-be-unsafe functions. Usually they access static variables without synchronization (e.g. gmtime(3)) or utilize signals in a racy way. The set of functions to check is specified with the FunctionSet option.

      -

      Note that using some thread-unsafe functions may be still valid in concurrent programming if only a single thread is used (e.g. setenv(3)), however, some functions may track a state in global variables which would be clobbered by subsequent (non-parallel, but concurrent) calls to a related function. E.g. the following code suffers from unprotected accesses to a global state:

      -
      // getnetent(3) maintains global state with DB connection, etc.
      -// If a concurrent green thread calls getnetent(3), the global state is corrupted.
      -netent = getnetent();
      +
      + +
      +

      clang-analyzer-webkit.NoUncountedMemberChecker

      +

      Check for no uncounted member variables.

      +

      The clang-analyzer-webkit.NoUncountedMemberChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> + + INFO + + + clang-analyzer-webkit.RefCntblBaseVirtualDtor + clang-analyzer-webkit.RefCntblBaseVirtualDtor + + +

      clang-tidy - clang-analyzer-webkit.RefCntblBaseVirtualDtor

      + +
      + +
      +

      clang-analyzer-webkit.RefCntblBaseVirtualDtor

      +

      Check for any ref-countable base class having virtual destructor.

      +

      The clang-analyzer-webkit.RefCntblBaseVirtualDtor check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      + + clang-analyzer-webkit.UncountedLambdaCapturesChecker + clang-analyzer-webkit.UncountedLambdaCapturesChecker + + +

      clang-tidy - clang-analyzer-webkit.UncountedLambdaCapturesChecker

      + +
      + +
      +

      clang-analyzer-webkit.UncountedLambdaCapturesChecker

      +

      Check uncounted lambda captures.

      +

      The clang-analyzer-webkit.UncountedLambdaCapturesChecker check is an alias, please see Clang Static Analyzer Available Checkers for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      + + concurrency-mt-unsafe + concurrency-mt-unsafe + + +

      clang-tidy - concurrency-mt-unsafe

      + +

      concurrency-mt-unsafe

      +

      Checks for some thread-unsafe functions against a black list of known-to-be-unsafe functions. Usually they access static variables without synchronization (e.g. gmtime(3)) or utilize signals in a racy way. The set of functions to check is specified with the FunctionSet option.

      +

      Note that using some thread-unsafe functions may be still valid in concurrent programming if only a single thread is used (e.g. setenv(3)), however, some functions may track a state in global variables which would be clobbered by subsequent (non-parallel, but concurrent) calls to a related function. E.g. the following code suffers from unprotected accesses to a global state:

      +
      // getnetent(3) maintains global state with DB connection, etc.
      +// If a concurrent green thread calls getnetent(3), the global state is corrupted.
      +netent = getnetent();
       yield();
       netent = getnetent();

      Examples:

      @@ -5779,9 +7231,7 @@ sleep(1); // implementation may use SIGALRM

      concurrency-thread-canceltype-asynchronous

      Finds pthread_setcanceltype function calls where a thread's cancellation type is set to asynchronous. Asynchronous cancellation type (PTHREAD_CANCEL_ASYNCHRONOUS) is generally unsafe, use type PTHREAD_CANCEL_DEFERRED instead which is the default. Even with deferred cancellation, a cancellation point in an asynchronous signal handler may still be acted upon and the effect is as if it was an asynchronous cancellation.

      -
      -

      pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);

      -
      +
      pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);

      This check corresponds to the CERT C Coding Standard rule POS47-C. Do not use threads that can be canceled asynchronously.

      References

      clang.llvm.org

      ]]> @@ -5799,12 +7249,122 @@ sleep(1); // implementation may use SIGALRM

    cppcoreguidelines-avoid-c-arrays

    -

    The cppcoreguidelines-avoid-c-arrays check is an alias, please see modernize-avoid-c-arrays for more information.

    +

    The cppcoreguidelines-avoid-c-arrays check is an alias, please see modernize-avoid-c-arrays <../modernize/avoid-c-arrays> for more information.

    References

    clang.llvm.org

    ]]> INFO + + cppcoreguidelines-avoid-capturing-lambda-coroutines + cppcoreguidelines-avoid-capturing-lambda-coroutines + + +

    clang-tidy - cppcoreguidelines-avoid-capturing-lambda-coroutines

    + +

    cppcoreguidelines-avoid-capturing-lambda-coroutines

    +

    Flags C++20 coroutine lambdas with non-empty capture lists that may cause use-after-free errors and suggests avoiding captures or ensuring the lambda closure object has a guaranteed lifetime.

    +

    This check implements CP.51 from the C++ Core Guidelines.

    +

    Using coroutine lambdas with non-empty capture lists can be risky, as capturing variables can lead to accessing freed memory after the first suspension point. This issue can occur even with refcounted smart pointers and copyable types. When a lambda expression creates a coroutine, it results in a closure object with storage, which is often on the stack and will eventually go out of scope. When the closure object goes out of scope, its captures also go out of scope. While normal lambdas finish executing before this happens, coroutine lambdas may resume from suspension after the closure object has been destructed, resulting in use-after-free memory access for all captures.

    +

    Consider the following example:

    +
    int value = get_value();
    +std::shared_ptr<Foo> sharedFoo = get_foo();
    +{
    +    const auto lambda = [value, sharedFoo]() -> std::future<void>
    +    {
    +        co_await something();
    +        // "sharedFoo" and "value" have already been destroyed
    +        // the "shared" pointer didn't accomplish anything
    +    };
    +    lambda();
    +} // the lambda closure object has now gone out of scope
    +

    In this example, the lambda object is defined with two captures: value and sharedFoo. When lambda() is called, the lambda object is created on the stack, and the captures are copied into the closure object. When the coroutine is suspended, the lambda object goes out of scope, and the closure object is destroyed. When the coroutine is resumed, the captured variables may have been destroyed, resulting in use-after-free bugs.

    +

    In conclusion, the use of coroutine lambdas with non-empty capture lists can lead to use-after-free errors when resuming the coroutine after the closure object has been destroyed. This check helps prevent such errors by flagging C++20 coroutine lambdas with non-empty capture lists and suggesting avoiding captures or ensuring the lambda closure object has a guaranteed lifetime.

    +

    Following these guidelines can help ensure the safe and reliable use of coroutine lambdas in C++ code.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + cppcoreguidelines-avoid-const-or-ref-data-members + cppcoreguidelines-avoid-const-or-ref-data-members + + +

    clang-tidy - cppcoreguidelines-avoid-const-or-ref-data-members

    + +

    cppcoreguidelines-avoid-const-or-ref-data-members

    +

    This check warns when structs or classes that are copyable or movable, and have const-qualified or reference (lvalue or rvalue) data members. Having such members is rarely useful, and makes the class only copy-constructible but not copy-assignable.

    +

    Examples:

    +
    // Bad, const-qualified member
    +struct Const {
    +  const int x;
    +}
    +
    +// Good:
    +class Foo {
    + public:
    +  int get() const { return x; }
    + private:
    +  int x;
    +};
    +
    +// Bad, lvalue reference member
    +struct Ref {
    +  int& x;
    +};
    +
    +// Good:
    +struct Foo {
    +  int* x;
    +  std::unique_ptr<int> x;
    +  std::shared_ptr<int> x;
    +  gsl::not_null<int> x;
    +};
    +
    +// Bad, rvalue reference member
    +struct RefRef {
    +  int&& x;
    +};
    +

    This check implements C.12 from the C++ Core Guidelines.

    +

    Further reading: Data members: Never const.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + cppcoreguidelines-avoid-do-while + cppcoreguidelines-avoid-do-while + + +

    clang-tidy - cppcoreguidelines-avoid-do-while

    + +

    cppcoreguidelines-avoid-do-while

    +

    Warns when using do-while loops. They are less readable than plain while loops, since the termination condition is at the end and the condition is not checked prior to the first iteration. This can lead to subtle bugs.

    +

    This check implements ES.75 from the C++ Core Guidelines.

    +

    Examples:

    +
    int x;
    +do {
    +    std::cin >> x;
    +    // ...
    +} while (x < 0);
    +

    Options

    +
    +

    IgnoreMacros

    +

    Ignore the check when analyzing macros. This is useful for safely defining function-like macros:

    +
    #define FOO_BAR(x) \
    +do { \
    +  foo(x); \
    +  bar(x); \
    +} while(0)
    +

    Defaults to false.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    cppcoreguidelines-avoid-goto cppcoreguidelines-avoid-goto @@ -5814,7 +7374,7 @@ sleep(1); // implementation may use SIGALRM

    cppcoreguidelines-avoid-goto

    The usage of goto for control flow is error prone and should be replaced with looping constructs. Only forward jumps in nested loops are accepted.

    -

    This check implements ES.76 from the CppCoreGuidelines and 6.3.1 from High Integrity C++.

    +

    This check implements ES.76 from the C++ Core Guidelines and 6.3.1 from High Integrity C++ Coding Standard.

    For more information on why to avoid programming with goto you can read the famous paper A Case against the GO TO Statement..

    The check diagnoses goto for backward jumps in every language mode. These should be replaced with C/C++ looping constructs.

    // Bad, handwritten for loop.
    @@ -5857,7 +7417,7 @@ some_operation();

    cppcoreguidelines-avoid-magic-numbers

    -

    The cppcoreguidelines-avoid-magic-numbers check is an alias, please see readability-magic-numbers for more information.

    +

    The cppcoreguidelines-avoid-magic-numbers check is an alias, please see readability-magic-numbers <../readability/magic-numbers> for more information.

    References

    clang.llvm.org

    ]]>
    @@ -5871,7 +7431,7 @@ some_operation();

    clang-tidy - cppcoreguidelines-avoid-non-const-global-variables

    cppcoreguidelines-avoid-non-const-global-variables

    -

    Finds non-const global variables as described in I.2 of C++ Core Guidelines . As R.6 of C++ Core Guidelines is a duplicate of rule I.2 it also covers that rule.

    +

    Finds non-const global variables as described in I.2 of C++ Core Guidelines. As R.6 of C++ Core Guidelines is a duplicate of rule I.2 it also covers that rule.

    char a;  // Warns!
     const char b =  0;
     
    @@ -5895,12 +7455,33 @@ protected:
     private:
         char h = 0;
     };
    -

    Variables: a, c, c_ptr1, c_ptr2, c_const_ptr and c_reference, will all generate warnings since they are either: a globally accessible variable and non-const, a pointer or reference providing global access to non-const data or both.

    +

    The variables a, c, c_ptr1, c_const_ptr and c_reference will all generate warnings since they are either a non-const globally accessible variable, a pointer or a reference providing global access to non-const data or both.

    References

    clang.llvm.org

    ]]> INFO
    + + cppcoreguidelines-avoid-reference-coroutine-parameters + cppcoreguidelines-avoid-reference-coroutine-parameters + + +

    clang-tidy - cppcoreguidelines-avoid-reference-coroutine-parameters

    + +

    cppcoreguidelines-avoid-reference-coroutine-parameters

    +

    Warns when a coroutine accepts reference parameters. After a coroutine suspend point, references could be dangling and no longer valid. Instead, pass parameters as values.

    +

    Examples:

    +
    std::future<int> someCoroutine(int& val) {
    +  co_await ...;
    +  // When the coroutine is resumed, 'val' might no longer be valid.
    +  if (val) ...
    +}
    +

    This check implements CP.53 from the C++ Core Guidelines.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    cppcoreguidelines-c-copy-assignment-signature cppcoreguidelines-c-copy-assignment-signature @@ -5912,7 +7493,7 @@ private:

    cppcoreguidelines-c-copy-assignment-signature

    -

    The cppcoreguidelines-c-copy-assignment-signature check is an alias, please see misc-unconventional-assign-operator for more information.

    +

    The cppcoreguidelines-c-copy-assignment-signature check is an alias, please see misc-unconventional-assign-operator <../misc/unconventional-assign-operator> for more information.

    References

    clang.llvm.org

    ]]> @@ -5929,7 +7510,7 @@ private:

    cppcoreguidelines-explicit-virtual-functions

    -

    The cppcoreguidelines-explicit-virtual-functions check is an alias, please see modernize-use-override for more information.

    +

    The cppcoreguidelines-explicit-virtual-functions check is an alias, please see modernize-use-override <../modernize/use-override> for more information.

    References

    clang.llvm.org

    ]]> @@ -5944,6 +7525,7 @@ private:

    cppcoreguidelines-init-variables

    Checks whether there are local variables that are declared without an initial value. These may lead to unexpected behavior if there is a code path that reads the variable before assigning to it.

    +

    This rule is part of the Type safety (Type.5) profile and ES.20 from the C++ Core Guidelines.

    Only integers, booleans, floats, doubles and pointers are checked. The fix option initializes all detected values with the value of zero. An exception is float and double types, which are initialized to NaN.

    As an example a function that looks like this:

    void function() {
    @@ -5997,12 +7579,29 @@ void function() {
     
     

    cppcoreguidelines-interfaces-global-init

    This check flags initializers of globals that access extern objects, and therefore can lead to order-of-initialization problems.

    -

    This rule is part of the "Interfaces" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-global-init

    +

    This check implements I.22 from the C++ Core Guidelines.

    Note that currently this does not flag calls to non-constexpr functions, and therefore globals could still be accessed from functions themselves.

    References

    clang.llvm.org

    ]]> + + cppcoreguidelines-macro-to-enum + cppcoreguidelines-macro-to-enum + + +

    clang-tidy - cppcoreguidelines-macro-to-enum

    + +
    + +
    +

    cppcoreguidelines-macro-to-enum

    +

    The cppcoreguidelines-macro-to-enum check is an alias, please see modernize-macro-to-enum <../modernize/macro-to-enum> for more information.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    cppcoreguidelines-macro-usage cppcoreguidelines-macro-usage @@ -6012,7 +7611,7 @@ void function() {

    cppcoreguidelines-macro-usage

    Finds macro usage that is considered problematic because better language constructs exist for the task.

    -

    The relevant sections in the C++ Core Guidelines are ES.31, and ES.32.

    +

    The relevant sections in the C++ Core Guidelines are ES.31, and ES.32.

    Examples:

    #define C 0
     #define F1(x, y) ((a) > (b) ? (a) : (b))
    @@ -6054,6 +7653,87 @@ test.cpp:3:9: warning: variadic macro 'F2' used; consider using a 'c
           
         INFO
         
    +  
    +    cppcoreguidelines-misleading-capture-default-by-value
    +    cppcoreguidelines-misleading-capture-default-by-value
    +    
    +      
    +

    clang-tidy - cppcoreguidelines-misleading-capture-default-by-value

    + +

    cppcoreguidelines-misleading-capture-default-by-value

    +

    Warns when lambda specify a by-value capture default and capture this.

    +

    By-value capture defaults in member functions can be misleading about whether data members are captured by value or reference. This occurs because specifying the capture default [=] actually captures the this pointer by value, not the data members themselves. As a result, data members are still indirectly accessed via the captured this pointer, which essentially means they are being accessed by reference. Therefore, even when using [=], data members are effectively captured by reference, which might not align with the user's expectations.

    +

    Examples:

    +
    struct AClass {
    +  int member;
    +  void misleadingLogic() {
    +    int local = 0;
    +    member = 0;
    +    auto f = [=]() mutable {
    +      local += 1;
    +      member += 1;
    +    };
    +    f();
    +    // Here, local is 0 but member is 1
    +  }
    +
    +  void clearLogic() {
    +    int local = 0;
    +    member = 0;
    +    auto f = [this, local]() mutable {
    +      local += 1;
    +      member += 1;
    +    };
    +    f();
    +    // Here, local is 0 but member is 1
    +  }
    +};
    +

    This check implements F.54 from the C++ Core Guidelines.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + cppcoreguidelines-missing-std-forward + cppcoreguidelines-missing-std-forward + + +

    clang-tidy - cppcoreguidelines-missing-std-forward

    + +

    cppcoreguidelines-missing-std-forward

    +

    Warns when a forwarding reference parameter is not forwarded inside the function body.

    +

    Example:

    +
    template <class T>
    +void wrapper(T&& t) {
    +  impl(std::forward<T>(t), 1, 2); // Correct
    +}
    +
    +template <class T>
    +void wrapper2(T&& t) {
    +  impl(t, 1, 2); // Oops - should use std::forward<T>(t)
    +}
    +
    +template <class T>
    +void wrapper3(T&& t) {
    +  impl(std::move(t), 1, 2); // Also buggy - should use std::forward<T>(t)
    +}
    +
    +template <class F>
    +void wrapper_function(F&& f) {
    +  std::forward<F>(f)(1, 2); // Correct
    +}
    +
    +template <class F>
    +void wrapper_function2(F&& f) {
    +  f(1, 2); // Incorrect - may not invoke the desired qualified function operator
    +}
    +

    This check implements F.19 from the C++ Core Guidelines.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    cppcoreguidelines-narrowing-conversions cppcoreguidelines-narrowing-conversions @@ -6063,8 +7743,7 @@ test.cpp:3:9: warning: variadic macro 'F2' used; consider using a 'c

    cppcoreguidelines-narrowing-conversions

    Checks for silent narrowing conversions, e.g: int i = 0; i += 0.1;. While the issue is obvious in this former example, it might not be so in the following: void MyClass::f(double d) { int_member_ += d; }.

    -

    This rule is part of the "Expressions and statements" profile of the C++ Core Guidelines, corresponding to rule ES.46. See

    -

    https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es46-avoid-lossy-narrowing-truncating-arithmetic-conversions.

    +

    This check implements ES.46 from the C++ Core Guidelines.

    We enforce only part of the guideline, more specifically, we flag narrowing conversions from:
      @@ -6136,7 +7815,8 @@ test.cpp:3:9: warning: variadic macro 'F2' used; consider using a 'c

      clang-tidy - cppcoreguidelines-no-malloc

      cppcoreguidelines-no-malloc

      -

      This check handles C-Style memory management using malloc(), realloc(), calloc() and free(). It warns about its use and tries to suggest the use of an appropriate RAII object. Furthermore, it can be configured to check against a user-specified list of functions that are used for memory management (e.g. posix_memalign()). See C++ Core Guidelines.

      +

      This check handles C-Style memory management using malloc(), realloc(), calloc() and free(). It warns about its use and tries to suggest the use of an appropriate RAII object. Furthermore, it can be configured to check against a user-specified list of functions that are used for memory management (e.g. posix_memalign()).

      +

      This check implements R.10 from the C++ Core Guidelines.

      There is no attempt made to provide fix-it hints, since manual resource management isn't easily transformed automatically into RAII.

      // Warns each of the following lines.
       // Containers like std::vector or std::string should be used.
      @@ -6166,6 +7846,93 @@ struct some_struct* s = (struct some_struct*) malloc(sizeof(struct some_struct))
             
           INFO
           
      +  
      +    cppcoreguidelines-no-suspend-with-lock
      +    cppcoreguidelines-no-suspend-with-lock
      +    
      +      
      +

      clang-tidy - cppcoreguidelines-no-suspend-with-lock

      + +

      cppcoreguidelines-no-suspend-with-lock

      +

      Flags coroutines that suspend while a lock guard is in scope at the suspension point.

      +

      When a coroutine suspends, any mutexes held by the coroutine will remain locked until the coroutine resumes and eventually destructs the lock guard. This can lead to long periods with a mutex held and runs the risk of deadlock.

      +

      Instead, locks should be released before suspending a coroutine.

      +

      This check only checks suspending coroutines while a lock_guard is in scope; it does not consider manual locking or unlocking of mutexes, e.g., through calls to std::mutex::lock().

      +

      Examples:

      +
      future bad_coro() {
      +  std::lock_guard lock{mtx};
      +  ++some_counter;
      +  co_await something(); // Suspending while holding a mutex
      +}
      +
      +future good_coro() {
      +  {
      +    std::lock_guard lock{mtx};
      +    ++some_counter;
      +  }
      +  // Destroy the lock_guard to release the mutex before suspending the coroutine
      +  co_await something(); // Suspending while holding a mutex
      +}
      +

      This check implements CP.52 from the C++ Core Guidelines.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      + + cppcoreguidelines-noexcept-destructor + cppcoreguidelines-noexcept-destructor + + +

      clang-tidy - cppcoreguidelines-noexcept-destructor

      + +
      + +
      +

      cppcoreguidelines-noexcept-destructor

      +

      This check implements C.37 from the C++ Core Guidelines.

      +

      The cppcoreguidelines-noexcept-destructor check is an alias, please see performance-noexcept-destructor <../performance/noexcept-destructor> for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      + + cppcoreguidelines-noexcept-move-operations + cppcoreguidelines-noexcept-move-operations + + +

      clang-tidy - cppcoreguidelines-noexcept-move-operations

      + +
      + +
      +

      cppcoreguidelines-noexcept-move-operations

      +

      This check implements C.66 from the C++ Core Guidelines.

      +

      The cppcoreguidelines-noexcept-move-operations check is an alias, please see performance-noexcept-move-constructor <../performance/noexcept-move-constructor> for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      + + cppcoreguidelines-noexcept-swap + cppcoreguidelines-noexcept-swap + + +

      clang-tidy - cppcoreguidelines-noexcept-swap

      + +
      + +
      +

      cppcoreguidelines-noexcept-swap

      +

      This check implements C.83 , C.84 and C.85 from the C++ Core Guidelines.

      +

      The cppcoreguidelines-noexcept-swap check is an alias, please see performance-noexcept-swap <../performance/noexcept-swap> for more information.

      +

      References

      +

      clang.llvm.org

      ]]> +
      + INFO +
      cppcoreguidelines-non-private-member-variables-in-classes cppcoreguidelines-non-private-member-variables-in-classes @@ -6177,7 +7944,7 @@ struct some_struct* s = (struct some_struct*) malloc(sizeof(struct some_struct))

      cppcoreguidelines-non-private-member-variables-in-classes

      -

      The cppcoreguidelines-non-private-member-variables-in-classes check is an alias, please see misc-non-private-member-variables-in-classes for more information.

      +

      The cppcoreguidelines-non-private-member-variables-in-classes check is an alias, please see misc-non-private-member-variables-in-classes <../misc/non-private-member-variables-in-classes> for more information.

      References

      clang.llvm.org

      ]]> @@ -6192,9 +7959,9 @@ struct some_struct* s = (struct some_struct*) malloc(sizeof(struct some_struct))

      cppcoreguidelines-owning-memory

      This check implements the type-based semantics of gsl::owner<T*>, which allows static analysis on code, that uses raw pointers to handle resources like dynamic memory, but won't introduce RAII concepts.

      -

      The relevant sections in the C++ Core Guidelines are I.11, C.33, R.3 and GSL.Views The definition of a gsl::owner<T*> is straight forward

      +

      This check implements I.11, C.33, R.3 and GSL.Views from the C++ Core Guidelines. The definition of a gsl::owner<T*> is straight forward

      namespace gsl { template <typename T> owner = T; }
      -

      It is therefore simple to introduce the owner even without using an implementation of the Guideline Support Library.

      +

      It is therefore simple to introduce the owner even without using an implementation of the Guideline Support Library.

      All checks are purely type based and not (yet) flow sensitive.

      The following examples will demonstrate the correct and incorrect initializations of owners, assignment is handled the same way. Note that both new and malloc()-like resource functions are considered to produce resources.

      // Creating an owner with factory functions is checked.
      @@ -6294,7 +8061,7 @@ private:
       // Code, that yields a false positive.
       OwnedValue<gsl::owner<int*>> Owner(new int(42)); // Type deduction yield T -> int *
       // False positive, getValue returns int* and not gsl::owner<int*>
      -gsl::owner<int*> OwnedInt = Owner.getValue(); 
      +gsl::owner<int*> OwnedInt = Owner.getValue();

      Another limitation of the current implementation is only the type based checking. Suppose you have code like the following:

      // Two owners with assigned resources
       gsl::owner<int*> Owner1 = new int(42);
      @@ -6316,10 +8083,16 @@ Owner1 = nullptr;

      cppcoreguidelines-prefer-member-initializer

      Finds member initializations in the constructor body which can be converted into member initializers of the constructor instead. This not only improves the readability of the code but also positively affects its performance. Class-member assignments inside a control statement or following the first control statement are ignored.

      -

      This check implements C.49 from the CppCoreGuidelines.

      +

      This check implements C.49 from the C++ Core Guidelines.

      If the language version is C++ 11 or above, the constructor is the default constructor of the class, the field is not a bitfield (only in case of earlier language version than C++ 20), furthermore the assigned value is a literal, negated literal or enum constant then the preferred place of the initialization is at the class member declaration.

      -

      This latter rule is C.48 from CppCoreGuidelines.

      -

      Please note, that this check does not enforce this latter rule for initializations already implemented as member initializers. For that purpose see check modernize-use-default-member-init.

      +

      This latter rule is C.48 from the C++ Core Guidelines.

      +

      Please note, that this check does not enforce this latter rule for initializations already implemented as member initializers. For that purpose see check modernize-use-default-member-init <../modernize/use-default-member-init>.

      +
      +
      +

      Note

      +
      +

      Enforcement of rule C.48 in this check is deprecated, to be removed in clang-tidy version 19 (only C.49 will be enforced by this check then). Please use cppcoreguidelines-use-default-member-init <../cppcoreguidelines/use-default-member-init> to enforce rule C.48.

      +

      Example 1

      class C {
         int n;
      @@ -6341,7 +8114,8 @@ public:
           if (dice())
             return;
           m = 1;
      -  }
      + } +};

    Example 2

    class C {
       int n;
    @@ -6362,7 +8136,9 @@ public:
     }

    UseAssignment

    -

    If this option is set to true (default is false), the check will initialize members with an assignment. In this case the fix of the first example looks like this:

    +

    Note: this option is deprecated, to be removed in clang-tidy version 19. Please use the UseAssignment option from cppcoreguidelines-use-default-member-init <../cppcoreguidelines/use-default-member-init> instead.

    +

    If this option is set to true (by default UseAssignment from modernize-use-default-member-init +<../modernize/use-default-member-init> will be used), the check will initialize members with an assignment. In this case the fix of the first example looks like this:

    class C {
       int n = 1;
    @@ -6389,7 +8165,7 @@ public:
     

    cppcoreguidelines-pro-bounds-array-to-pointer-decay

    This check flags all array to pointer decays.

    Pointers should not be used as arrays. span<T> is a bounds-checked, safe alternative to using pointers to access arrays.

    -

    This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-bounds-decay.

    +

    This rule is part of the Bounds safety (Bounds 3) profile from the C++ Core Guidelines.

    References

    clang.llvm.org

    ]]> @@ -6404,7 +8180,7 @@ public:

    cppcoreguidelines-pro-bounds-constant-array-index

    This check flags all array subscript expressions on static arrays and std::arrays that either do not have a constant integer expression index or are out of bounds (for std::array). For out-of-bounds checking of static arrays, see the -Warray-bounds Clang diagnostic.

    -

    This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-bounds-arrayindex.

    +

    This rule is part of the Bounds safety (Bounds 2) profile from the C++ Core Guidelines.

    Optionally, this check can generate fixes using gsl::at for indexing.

    Options

    @@ -6430,7 +8206,7 @@ public:

    cppcoreguidelines-pro-bounds-pointer-arithmetic

    This check flags all usage of pointer arithmetic, because it could lead to an invalid pointer. Subtraction of two pointers is not flagged by this check.

    Pointers should only refer to single objects, and pointer arithmetic is fragile and easy to get wrong. span<T> is a bounds-checked, safe type for accessing arrays of data.

    -

    This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-bounds-arithmetic.

    +

    This rule is part of the Bounds safety (Bounds 1) profile from the C++ Core Guidelines.

    References

    clang.llvm.org

    ]]> @@ -6444,9 +8220,15 @@ public:

    clang-tidy - cppcoreguidelines-pro-type-const-cast

    cppcoreguidelines-pro-type-const-cast

    -

    This check flags all uses of const_cast in C++ code.

    -

    Modifying a variable that was declared const is undefined behavior, even with const_cast.

    -

    This rule is part of the "Type safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-type-constcast.

    +

    Imposes limitations on the use of const_cast within C++ code. It depends on the StrictMode option setting to determine whether it should flag all instances of const_cast or only those that remove either const or volatile qualifier.

    +

    Modifying a variable that has been declared as const in C++ is generally considered undefined behavior, and this remains true even when using const_cast. In C++, the const qualifier indicates that a variable is intended to be read-only, and the compiler enforces this by disallowing any attempts to change the value of that variable.

    +

    Removing the volatile qualifier in C++ can have serious consequences. This qualifier indicates that a variable's value can change unpredictably, and removing it may lead to undefined behavior, optimization problems, and debugging challenges. It's essential to retain the volatile qualifier in situations where the variable's volatility is a crucial aspect of program correctness and reliability.

    +

    This rule is part of the Type safety (Type 3) profile and ES.50: Don't cast away const rule from the C++ Core Guidelines.

    +

    Options

    +
    +

    StrictMode

    +

    When this setting is set to true, it means that any usage of const_cast is not allowed. On the other hand, when it's set to false, it permits casting to const or volatile types. Default value is false.

    +

    References

    clang.llvm.org

    ]]> @@ -6462,7 +8244,7 @@ public:

    cppcoreguidelines-pro-type-cstyle-cast

    This check flags all use of C-style casts that perform a static_cast downcast, const_cast, or reinterpret_cast.

    Use of these casts can violate type safety and cause the program to access a variable that is actually of type X to be accessed as if it were of an unrelated type Z. Note that a C-style (T)expression cast means to perform the first of the following that is possible: a const_cast, a static_cast, a static_cast followed by a const_cast, a reinterpret_cast, or a reinterpret_cast followed by a const_cast. This rule bans (T)expression only when used to perform an unsafe cast.

    -

    This rule is part of the "Type safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-type-cstylecast.

    +

    This rule is part of the Type safety (Type.4) profile from the C++ Core Guidelines.

    References

    clang.llvm.org

    ]]> @@ -6489,7 +8271,7 @@ public:

    UseAssignment

    If set to true, the check will provide fix-its with literal initializers ( int i = 0; ) instead of curly braces ( int i{}; ).

    -

    This rule is part of the "Type safety" profile of the C++ Core Guidelines, corresponding to rule Type.6. See https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-type-memberinit.

    +

    This rule is part of the Type safety (Type.6) profile from the C++ Core Guidelines.

    References

    clang.llvm.org

    ]]> @@ -6505,7 +8287,7 @@ public:

    cppcoreguidelines-pro-type-reinterpret-cast

    This check flags all uses of reinterpret_cast in C++ code.

    Use of these casts can violate type safety and cause the program to access a variable that is actually of type X to be accessed as if it were of an unrelated type Z.

    -

    This rule is part of the "Type safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-type-reinterpretcast.

    +

    This rule is part of the Type safety (Type.1.1) profile from the C++ Core Guidelines.

    References

    clang.llvm.org

    ]]> @@ -6521,7 +8303,12 @@ public:

    cppcoreguidelines-pro-type-static-cast-downcast

    This check flags all usages of static_cast, where a base class is casted to a derived class. In those cases, a fix-it is provided to convert the cast to a dynamic_cast.

    Use of these casts can violate type safety and cause the program to access a variable that is actually of type X to be accessed as if it were of an unrelated type Z.

    -

    This rule is part of the "Type safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-type-downcast.

    +

    This rule is part of the Type safety (Type.2) profile from the C++ Core Guidelines.

    +

    Options

    +
    +

    StrictMode

    +

    When set to false, no warnings are emitted for casts on non-polymorphic types. Default is true.

    +

    References

    clang.llvm.org

    ]]> @@ -6537,7 +8324,7 @@ public:

    cppcoreguidelines-pro-type-union-access

    This check flags all access to members of unions. Passing unions as a whole is not flagged.

    Reading from a union member assumes that member was the last one written, and writing to a union member assumes another member with a nontrivial destructor had its destructor called. This is fragile because it cannot generally be enforced to be safe in the language and so relies on programmer discipline to get it right.

    -

    This rule is part of the "Type safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-type-unions.

    +

    This rule is part of the Type safety (Type.7) profile from the C++ Core Guidelines.

    References

    clang.llvm.org

    ]]> @@ -6552,33 +8339,97 @@ public:

    cppcoreguidelines-pro-type-vararg

    This check flags all calls to c-style vararg functions and all use of va_arg.

    -

    To allow for SFINAE use of vararg functions, a call is not flagged if a literal 0 is passed as the only vararg argument.

    +

    To allow for SFINAE use of vararg functions, a call is not flagged if a literal 0 is passed as the only vararg argument or function is used in unevaluated context.

    Passing to varargs assumes the correct type will be read. This is fragile because it cannot generally be enforced to be safe in the language and so relies on programmer discipline to get it right.

    -

    This rule is part of the "Type safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-type-varargs.

    +

    This rule is part of the Type safety (Type.8) profile from the C++ Core Guidelines.

    References

    clang.llvm.org

    ]]> INFO - cppcoreguidelines-slicing - cppcoreguidelines-slicing + cppcoreguidelines-rvalue-reference-param-not-moved + cppcoreguidelines-rvalue-reference-param-not-moved -

    clang-tidy - cppcoreguidelines-slicing

    +

    clang-tidy - cppcoreguidelines-rvalue-reference-param-not-moved

    -

    cppcoreguidelines-slicing

    -

    Flags slicing of member variables or vtable. Slicing happens when copying a derived object into a base object: the members of the derived object (both member variables and virtual member functions) will be discarded. This can be misleading especially for member function slicing, for example:

    -
    struct B { int a; virtual int f(); };
    -struct D : B { int b; int f() override; };
    -
    +

    cppcoreguidelines-rvalue-reference-param-not-moved

    +

    Warns when an rvalue reference function parameter is never moved within the function body.

    +

    Rvalue reference parameters indicate a parameter that should be moved with std::move from within the function body. Any such parameter that is never moved is confusing and potentially indicative of a buggy program.

    +

    Example:

    +
    void logic(std::string&& Input) {
    +  std::string Copy(Input); // Oops - forgot to std::move
    +}
    +

    Note that parameters that are unused and marked as such will not be diagnosed.

    +

    Example:

    +
    void conditional_use([[maybe_unused]] std::string&& Input) {
    +  // No diagnostic here since Input is unused and marked as such
    +}
    +

    Options

    +
    +

    AllowPartialMove

    +

    If set to true, the check accepts std::move calls containing any subexpression containing the parameter. CppCoreGuideline F.18 officially mandates that the parameter itself must be moved. Default is false.

    +
    // 'p' is flagged by this check if and only if AllowPartialMove is false
    +void move_members_of(pair<Obj, Obj>&& p) {
    +  pair<Obj, Obj> other;
    +  other.first = std::move(p.first);
    +  other.second = std::move(p.second);
    +}
    +
    +// 'p' is never flagged by this check
    +void move_whole_pair(pair<Obj, Obj>&& p) {
    +  pair<Obj, Obj> other = std::move(p);
    +}
    +
    +
    +

    IgnoreUnnamedParams

    +

    If set to true, the check ignores unnamed rvalue reference parameters. Default is false.

    +
    +
    +

    IgnoreNonDeducedTemplateTypes

    +

    If set to true, the check ignores non-deduced template type rvalue reference parameters. Default is false.

    +
    template <class T>
    +struct SomeClass {
    +  // Below, 'T' is not deduced and 'T&&' is an rvalue reference type.
    +  // This will be flagged if and only if IgnoreNonDeducedTemplateTypes is
    +  // false. One suggested fix would be to specialize the class for 'T' and
    +  // 'T&' separately (e.g., see std::future), or allow only one of 'T' or
    +  // 'T&' instantiations of SomeClass (e.g., see std::optional).
    +  SomeClass(T&& t) { }
    +};
    +
    +// Never flagged, since 'T' is a forwarding reference in a deduced context
    +template <class T>
    +void forwarding_ref(T&& t) {
    +  T other = std::forward<T>(t);
    +}
    +
    +

    This check implements F.18 from the C++ Core Guidelines.

    +

    References

    +

    clang.llvm.org

    ]]> + + INFO + + + cppcoreguidelines-slicing + cppcoreguidelines-slicing + + +

    clang-tidy - cppcoreguidelines-slicing

    + +

    cppcoreguidelines-slicing

    +

    Flags slicing of member variables or vtable. Slicing happens when copying a derived object into a base object: the members of the derived object (both member variables and virtual member functions) will be discarded. This can be misleading especially for member function slicing, for example:

    +
    struct B { int a; virtual int f(); };
    +struct D : B { int b; int f() override; };
    +
     void use(B b) {  // Missing reference, intended?
       b.f();  // Calls B::f.
     }
     
     D d;
     use(d);  // Slice.
    -

    See the relevant C++ Core Guidelines sections for details: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es63-dont-slice https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c145-access-polymorphic-objects-through-pointers-and-references

    +

    This check implements ES.63 and C.145 from the C++ Core Guidelines.

    References

    clang.llvm.org

    ]]>
    @@ -6594,14 +8445,23 @@ use(d); // Slice.

    The check finds classes where some but not all of the special member functions are defined.

    By default the compiler defines a copy constructor, copy assignment operator, move constructor, move assignment operator and destructor. The default can be suppressed by explicit user-definitions. The relationship between which functions will be suppressed by definitions of other functions is complicated and it is advised that all five are defaulted or explicitly defined.

    Note that defining a function with = delete is considered to be a definition.

    -

    This rule is part of the "Constructors, assignments, and destructors" profile of the C++ Core Guidelines, corresponding to rule C.21. See

    -

    https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-default-operation-define-or-delete-them-all.

    +

    This check implements C.21 from the C++ Core Guidelines.

    Options

    AllowSoleDefaultDtor

    -

    When set to true (default is false), this check doesn't flag classes with a sole, explicitly defaulted destructor. An example for such a class is:

    -
    struct A {
    +

    When set to true (default is false), this check will only trigger on destructors if they are defined and not defaulted.

    +
    struct A { // This is fine.
       virtual ~A() = default;
    +};
    +
    +struct B { // This is not fine.
    +  ~B() {}
    +};
    +
    +struct C {
    +  // This is not checked, because the destructor might be defaulted in
    +  // another translation unit.
    +  ~C();
     };
    @@ -6627,6 +8487,24 @@ use(d); // Slice.
    MINOR
    + + cppcoreguidelines-use-default-member-init + cppcoreguidelines-use-default-member-init + + +

    clang-tidy - cppcoreguidelines-use-default-member-init

    + +
    + +
    +

    cppcoreguidelines-use-default-member-init

    +

    This check implements C.48 from the C++ Core Guidelines.

    +

    The cppcoreguidelines-use-default-member-init check is an alias, please see modernize-use-default-member-init <../modernize/use-default-member-init> for more information.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    cppcoreguidelines-virtual-class-destructor cppcoreguidelines-virtual-class-destructor @@ -6636,7 +8514,7 @@ use(d); // Slice.

    cppcoreguidelines-virtual-class-destructor

    Finds virtual classes whose destructor is neither public and virtual nor protected and non-virtual. A virtual class's destructor should be specified in one of these ways to prevent undefined behavior.

    -

    This check implements C.35 from the CppCoreGuidelines.

    +

    This check implements C.35 from the C++ Core Guidelines.

    Note that this check will diagnose a class with a virtual method regardless of whether the class is used as a base class or not.

    Fixes are available for user-declared and implicit destructors that are either public and non-virtual or protected and virtual. No fixes are offered for private destructors. There, the decision whether to make them private and virtual or protected and non-virtual depends on the use case and is thus left to the user.

    Example

    @@ -6719,7 +8597,7 @@ public:

    A function call expression that uses a default argument will be diagnosed. Calling it without defaults will not cause a warning:

    foo();  // warning
     foo(0); // no warning
    -

    See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md

    +

    See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en

    References

    clang.llvm.org

    ]]> @@ -6737,7 +8615,7 @@ foo(0); // no warning

    For example, the declaration:

    int foo(int value = 5) { return value; }

    will cause a warning.

    -

    See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md

    +

    See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en

    References

    clang.llvm.org

    ]]> @@ -6754,7 +8632,7 @@ foo(0); // no warning

    fuchsia-header-anon-namespaces

    -

    The fuchsia-header-anon-namespaces check is an alias, please see google-build-namespace for more information.

    +

    The fuchsia-header-anon-namespaces check is an alias, please see google-build-namespace <../google/build-namespaces> for more information.

    References

    clang.llvm.org

    ]]> @@ -6798,7 +8676,7 @@ class Good_Child1 : public Interface_A, Interface_B { virtual int foo() override { return 0; } virtual int bar() override { return 0; } }; -

    See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md

    +

    See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en

    References

    clang.llvm.org

    ]]> @@ -6818,7 +8696,7 @@ class Good_Child1 : public Interface_A, Interface_B { B &operator=(const B &Other); // No warning B &operator=(B &&Other) // No warning -

    See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md

    +

    See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en

    References

    clang.llvm.org

    ]]> @@ -6845,8 +8723,8 @@ private: class C { public: - C(int Val) : Val(Val) {} - constexpr C() : Val(0) {} + constexpr C(int Val) : Val(Val) {} + C(int Val1, int Val2) : Val(Val1+Val2) {} private: int Val; @@ -6861,8 +8739,8 @@ static C c2(0, 1); // Warning, as constructor is not constexpr static int i; // No warning, as it is trivial extern int get_i(); -static C(get_i()) // Warning, as the constructor is dynamically initialized -

    See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md

    +static C c3(get_i());// Warning, as the constructor is dynamically initialized +

    See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en

    References

    clang.llvm.org

    ]]> @@ -6894,7 +8772,7 @@ template <typename T1, typename T2> auto fn(const T1 &lhs, const T2 &rhs) -> decltype(lhs + rhs) { return lhs + rhs; } -

    See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md

    +

    See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en

    References

    clang.llvm.org

    ]]> @@ -6911,7 +8789,7 @@ auto fn(const T1 &lhs, const T2 &rhs) -> decltype(lhs + rhs) {

    Warns if classes are defined with virtual inheritance.

    For example, classes should not be defined with virtual inheritance:

    class B : public virtual A {};   // warning
    -

    See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md

    +

    See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en

    References

    clang.llvm.org

    ]]> @@ -6948,7 +8826,8 @@ auto fn(const T1 &lhs, const T2 &rhs) -> decltype(lhs + rhs) {

    Options

    HeaderFileExtensions

    -

    A comma-separated list of filename extensions of header files (the filename extensions should not include "." prefix). Default is "h,hh,hpp,hxx". For header files without an extension, use an empty string (if there are no other desired extensions) or leave an empty element in the list. e.g., "h,hh,hpp,hxx," (note the trailing comma).

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. Please use the global configuration option HeaderFileExtensions.

    +

    A comma-separated list of filename extensions of header files (the filename extensions should not include "." prefix). Default is "h,hh,hpp,hxx". For header files without an extension, use an empty string (if there are no other desired extensions) or leave an empty element in the list. E.g., "h,hh,hpp,hxx," (note the trailing comma).

    References

    clang.llvm.org

    ]]> @@ -7044,7 +8923,8 @@ bool f() {

    Options

    HeaderFileExtensions

    -

    A comma-separated list of filename extensions of header files (the filename extensions should not contain "." prefix). Default is "h". For header files without an extension, use an empty string (if there are no other desired extensions) or leave an empty element in the list. e.g., "h,hh,hpp,hxx," (note the trailing comma).

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. Please use the global configuration option HeaderFileExtensions.

    +

    A comma-separated list of filename extensions of header files (the filename extensions should not contain "." prefix). Default is "h". For header files without an extension, use an empty string (if there are no other desired extensions) or leave an empty element in the list. E.g., "h,hh,hpp,hxx," (note the trailing comma).

    References

    clang.llvm.org

    ]]> @@ -7162,7 +9042,7 @@ bool *ABCIsNegative(int i) { return i < 0; }

    clang-tidy - google-readability-avoid-underscore-in-googletest-name

    google-readability-avoid-underscore-in-googletest-name

    -

    Checks whether there are underscores in googletest test and test case names in test macros:

    +

    Checks whether there are underscores in googletest test suite names and test names in test macros:

    • TEST
    • TEST_F
    • @@ -7172,10 +9052,10 @@ bool *ABCIsNegative(int i) { return i < 0; }

    The FRIEND_TEST macro is not included.

    For example:

    -
    TEST(TestCaseName, Illegal_TestName) {}
    -TEST(Illegal_TestCaseName, TestName) {}
    -

    would trigger the check. Underscores are not allowed in test names nor test case names.

    -

    The DISABLED_ prefix, which may be used to disable individual tests, is ignored when checking test names, but the rest of the rest of the test name is still checked.

    +
    TEST(TestSuiteName, Illegal_TestName) {}
    +TEST(Illegal_TestSuiteName, TestName) {}
    +

    would trigger the check. Underscores are not allowed in test suite name nor test names.

    +

    The DISABLED_ prefix, which may be used to disable test suites and individual tests, is removed from the test suite name and test name before checking for underscores.

    This check does not propose any fixes.

    References

    clang.llvm.org

    ]]> @@ -7193,7 +9073,7 @@ TEST(Illegal_TestCaseName, TestName) {}

    google-readability-braces-around-statements

    -

    The google-readability-braces-around-statements check is an alias, please see readability-braces-around-statements for more information.

    +

    The google-readability-braces-around-statements check is an alias, please see readability-braces-around-statements <../readability/braces-around-statements> for more information.

    References

    clang.llvm.org

    ]]> @@ -7227,7 +9107,7 @@ TEST(Illegal_TestCaseName, TestName) {}

    google-readability-function-size

    -

    The google-readability-function-size check is an alias, please see readability-function-size for more information.

    +

    The google-readability-function-size check is an alias, please see readability-function-size <../readability/function-size> for more information.

    References

    clang.llvm.org

    ]]> @@ -7244,7 +9124,7 @@ TEST(Illegal_TestCaseName, TestName) {}

    google-readability-namespace-comments

    -

    The google-readability-namespace-comments check is an alias, please see llvm-namespace-comment for more information.

    +

    The google-readability-namespace-comments check is an alias, please see llvm-namespace-comment <../llvm/namespace-comment> for more information.

    References

    clang.llvm.org

    ]]> @@ -7361,7 +9241,7 @@ TYPED_TEST_SUITE(BarTest, BarTypes);

    hicpp-avoid-c-arrays

    -

    The hicpp-avoid-c-arrays check is an alias, please see modernize-avoid-c-arrays for more information.

    +

    The hicpp-avoid-c-arrays check is an alias, please see modernize-avoid-c-arrays <../modernize/avoid-c-arrays> for more information. It partly enforces the rule 4.1.1.

    References

    clang.llvm.org

    ]]> @@ -7373,10 +9253,12 @@ TYPED_TEST_SUITE(BarTest, BarTypes);

    clang-tidy - hicpp-avoid-goto

    + +
    +

    hicpp-avoid-goto

    -

    The hicpp-avoid-goto check is an alias to cppcoreguidelines-avoid-goto. Rule 6.3.1 High Integrity C++ requires that goto only skips parts of a block and is not used for other reasons.

    -

    Both coding guidelines implement the same exception to the usage of goto.

    +

    The hicpp-avoid-goto check is an alias, please see cppcoreguidelines-avoid-goto <../cppcoreguidelines/avoid-goto> for more information. It enforces the rule 6.3.1.

    References

    clang.llvm.org

    ]]>
    @@ -7392,7 +9274,7 @@ TYPED_TEST_SUITE(BarTest, BarTypes);

    hicpp-braces-around-statements

    -

    The hicpp-braces-around-statements check is an alias, please see readability-braces-around-statements for more information. It enforces the rule 6.1.1.

    +

    The hicpp-braces-around-statements check is an alias, please see readability-braces-around-statements <../readability/braces-around-statements> for more information. It enforces the rule 6.1.1.

    References

    clang.llvm.org

    ]]> @@ -7409,7 +9291,7 @@ TYPED_TEST_SUITE(BarTest, BarTypes);

    hicpp-deprecated-headers

    -

    The hicpp-deprecated-headers check is an alias, please see modernize-deprecated-headers for more information. It enforces the rule 1.3.3.

    +

    The hicpp-deprecated-headers check is an alias, please see modernize-deprecated-headers <../modernize/deprecated-headers> for more information. It enforces the rule 1.3.3.

    References

    clang.llvm.org

    ]]> @@ -7424,7 +9306,7 @@ TYPED_TEST_SUITE(BarTest, BarTypes);

    hicpp-exception-baseclass

    Ensure that every value that in a throw expression is an instance of std::exception.

    -

    This enforces rule 15.1 of the High Integrity C++ Coding Standard.

    +

    This enforces rule 15.1 of the High Integrity C++ Coding Standard.

    class custom_exception {};
     
     void throwing() noexcept(false) {
    @@ -7457,12 +9339,12 @@ void throwing2() noexcept(false) {
     
     
     

    hicpp-explicit-conversions

    -

    This check is an alias for google-explicit-constructor. Used to enforce parts of rule 5.4.1. This check will enforce that constructors and conversion operators are marked explicit. Other forms of casting checks are implemented in other places. The following checks can be used to check for more forms of casting:

    +

    This check is an alias for google-explicit-constructor <../google/explicit-constructor>. Used to enforce parts of rule 5.4.1. This check will enforce that constructors and conversion operators are marked explicit. Other forms of casting checks are implemented in other places. The following checks can be used to check for more forms of casting:

    References

    clang.llvm.org

    ]]> @@ -7479,17 +9361,38 @@ void throwing2() noexcept(false) {

    hicpp-function-size

    -

    This check is an alias for readability-function-size. Useful to enforce multiple sections on function complexity.

    +

    This check is an alias for readability-function-size <../readability/function-size>. Useful to enforce multiple sections on function complexity.

    References

    clang.llvm.org

    ]]> INFO + + hicpp-ignored-remove-result + hicpp-ignored-remove-result + + +

    clang-tidy - hicpp-ignored-remove-result

    + +

    hicpp-ignored-remove-result

    +

    Ensure that the result of std::remove, std::remove_if and std::unique are not ignored according to rule 17.5.1.

    +

    The mutating algorithms std::remove, std::remove_if and both overloads of std::unique operate by swapping or moving elements of the range they are operating over. On completion, they return an iterator to the last valid element. In the majority of cases the correct behavior is to use this result as the first operand in a call to std::erase.

    +

    This check is a subset of bugprone-unused-return-value <../bugprone/unused-return-value> and depending on used options it can be superfluous to enable both checks.

    +

    Options

    +
    +

    AllowCastToVoid

    +

    Controls whether casting return values to void is permitted. Default: true.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    hicpp-invalid-access-moved hicpp-invalid-access-moved @@ -7501,8 +9404,8 @@ void throwing2() noexcept(false) {

    hicpp-invalid-access-moved

    -

    This check is an alias for bugprone-use-after-move.

    -

    Implements parts of the rule 8.4.1 to check if moved-from objects are accessed.

    +

    This check is an alias for bugprone-use-after-move <../bugprone/use-after-move>.

    +

    Implements parts of the rule 8.4.1 to check if moved-from objects are accessed.

    References

    clang.llvm.org

    ]]> @@ -7519,7 +9422,7 @@ void throwing2() noexcept(false) {

    hicpp-member-init

    -

    This check is an alias for cppcoreguidelines-pro-type-member-init. Implements the check for rule 12.4.2 to initialize class members in the right order.

    +

    This check is an alias for cppcoreguidelines-pro-type-member-init <../cppcoreguidelines/pro-type-member-init>. Implements the check for rule 12.4.2 to initialize class members in the right order.

    References

    clang.llvm.org

    ]]> @@ -7535,7 +9438,7 @@ void throwing2() noexcept(false) {

    hicpp-move-const-arg

    -

    The hicpp-move-const-arg check is an alias, please see performance-move-const-arg for more information. It enforces the rule 17.3.1.

    +

    The hicpp-move-const-arg check is an alias, please see performance-move-const-arg <../performance/move-const-arg> for more information. It enforces the rule 17.3.1.

    References

    clang.llvm.org

    ]]> @@ -7549,7 +9452,7 @@ void throwing2() noexcept(false) {

    clang-tidy - hicpp-multiway-paths-covered

    hicpp-multiway-paths-covered

    -

    This check discovers situations where code paths are not fully-covered. It furthermore suggests using if instead of switch if the code will be more clear. The rule 6.1.2 and rule 6.1.4 of the High Integrity C++ Coding Standard are enforced.

    +

    This check discovers situations where code paths are not fully-covered. It furthermore suggests using if instead of switch if the code will be more clear. The rule 6.1.2 and rule 6.1.4 of the High Integrity C++ Coding Standard are enforced.

    if-else if chains that miss a final else branch might lead to unexpected program execution and be the result of a logical error. If the missing else branch is intended you can leave it empty with a clarifying comment. This warning can be noisy on some code bases, so it is disabled by default.

    void f1() {
       int i = determineTheNumber();
    @@ -7585,7 +9488,7 @@ void f3(enum Color c) {
       }
       // Other cases missing
     }
    -

    The rule 6.1.4 requires every switch statement to have at least two case labels other than a default label. Otherwise, the switch could be better expressed with an if statement. Degenerated switch statements without any labels are caught as well.

    +

    The rule 6.1.4 requires every switch statement to have at least two case labels other than a default label. Otherwise, the switch could be better expressed with an if statement. Degenerated switch statements without any labels are caught as well.

    // Degenerated switch that could be better written as `if`
     int i = 42;
     switch(i) {
    @@ -7624,8 +9527,8 @@ switch(i) {}

    hicpp-named-parameter

    -

    This check is an alias for readability-named-parameter.

    -

    Implements rule 8.2.1.

    +

    This check is an alias for readability-named-parameter <../readability/named-parameter>.

    +

    Implements rule 8.2.1.

    References

    clang.llvm.org

    ]]> @@ -7642,7 +9545,7 @@ switch(i) {}

    hicpp-new-delete-operators

    -

    This check is an alias for misc-new-delete-overloads. Implements rule 12.3.1 to ensure the new and delete operators have the correct signature.

    +

    This check is an alias for misc-new-delete-overloads <../misc/new-delete-overloads>. Implements rule 12.3.1 to ensure the new and delete operators have the correct signature.

    References

    clang.llvm.org

    ]]> @@ -7659,7 +9562,7 @@ switch(i) {}

    hicpp-no-array-decay

    -

    The hicpp-no-array-decay check is an alias, please see cppcoreguidelines-pro-bounds-array-to-pointer-decay for more information. It enforces the rule 4.1.1.

    +

    The hicpp-no-array-decay check is an alias, please see cppcoreguidelines-pro-bounds-array-to-pointer-decay <../cppcoreguidelines/pro-bounds-array-to-pointer-decay> for more information. It enforces the rule 4.1.1.

    References

    clang.llvm.org

    ]]> @@ -7673,8 +9576,8 @@ switch(i) {}

    clang-tidy - hicpp-no-assembler

    hicpp-no-assembler

    -

    Check for assembler statements. No fix is offered.

    -

    Inline assembler is forbidden by the High Integrity C++ Coding Standard as it restricts the portability of code.

    +

    Checks for assembler statements. Use of inline assembly should be avoided since it restricts the portability of the code.

    +

    This enforces rule 7.5.1 of the High Integrity C++ Coding Standard.

    References

    clang.llvm.org

    ]]> @@ -7691,7 +9594,7 @@ switch(i) {}

    hicpp-no-malloc

    -

    The hicpp-no-malloc check is an alias, please see cppcoreguidelines-no-malloc for more information. It enforces the rule 5.3.2.

    +

    The hicpp-no-malloc check is an alias, please see cppcoreguidelines-no-malloc <../cppcoreguidelines/no-malloc> for more information. It enforces the rule 5.3.2.

    References

    clang.llvm.org

    ]]> @@ -7708,7 +9611,8 @@ switch(i) {}

    hicpp-noexcept-move

    -

    This check is an alias for performance-noexcept-move-constructor. Checks rule 12.5.4 to mark move assignment and move construction noexcept.

    +

    This check is an alias for performance-noexcept-move-constructor +<../performance/noexcept-move-constructor>. Checks rule 12.5.4 to mark move assignment and move construction noexcept.

    References

    clang.llvm.org

    ]]> @@ -7722,7 +9626,7 @@ switch(i) {}

    hicpp-signed-bitwise

    Finds uses of bitwise operations on signed integer types, which may lead to undefined or implementation defined behavior.

    -

    The according rule is defined in the High Integrity C++ Standard, Section 5.6.1.

    +

    The according rule is defined in the High Integrity C++ Standard, Section 5.6.1.

    Options

    IgnorePositiveIntegerLiterals

    @@ -7744,7 +9648,7 @@ switch(i) {}

    hicpp-special-member-functions

    -

    This check is an alias for cppcoreguidelines-special-member-functions. Checks that special member functions have the correct signature, according to rule 12.5.7.

    +

    This check is an alias for cppcoreguidelines-special-member-functions <../cppcoreguidelines/special-member-functions>. Checks that special member functions have the correct signature, according to rule 12.5.7.

    References

    clang.llvm.org

    ]]> @@ -7760,7 +9664,7 @@ switch(i) {}

    hicpp-static-assert

    -

    The hicpp-static-assert check is an alias, please see misc-static-assert for more information. It enforces the rule 7.1.10.

    +

    The hicpp-static-assert check is an alias, please see misc-static-assert <../misc/static-assert> for more information. It enforces the rule 7.1.10.

    References

    clang.llvm.org

    ]]> @@ -7777,7 +9681,7 @@ switch(i) {}

    hicpp-undelegated-constructor

    -

    This check is an alias for bugprone-undelegated-constructor. Partially implements rule 12.4.5 to find misplaced constructor calls inside a constructor.

    +

    This check is an alias for bugprone-undelegated-constructor <../bugprone/undelegated-constructor>. Partially implements rule 12.4.5 to find misplaced constructor calls inside a constructor.

    struct Ctor {
       Ctor();
       Ctor(int);
    @@ -7807,7 +9711,8 @@ switch(i) {}

    hicpp-uppercase-literal-suffix

    -

    The hicpp-uppercase-literal-suffix check is an alias, please see readability-uppercase-literal-suffix for more information.

    +

    The hicpp-uppercase-literal-suffix check is an alias, please see readability-uppercase-literal-suffix <../readability/uppercase-literal-suffix> for more information.

    +

    Partially implements rule 4.2.1 to ensure that the U suffix is writeln properly.

    References

    clang.llvm.org

    ]]> @@ -7824,7 +9729,7 @@ switch(i) {}

    hicpp-use-auto

    -

    The hicpp-use-auto check is an alias, please see modernize-use-auto for more information. It enforces the rule 7.1.8.

    +

    The hicpp-use-auto check is an alias, please see modernize-use-auto <../modernize/use-auto> for more information. It enforces the rule 7.1.8.

    References

    clang.llvm.org

    ]]> @@ -7841,7 +9746,7 @@ switch(i) {}

    hicpp-use-emplace

    -

    The hicpp-use-emplace check is an alias, please see modernize-use-emplace for more information. It enforces the rule 17.4.2.

    +

    The hicpp-use-emplace check is an alias, please see modernize-use-emplace <../modernize/use-emplace> for more information. It enforces the rule 17.4.2.

    References

    clang.llvm.org

    ]]> @@ -7858,7 +9763,7 @@ switch(i) {}

    hicpp-use-equals-default

    -

    This check is an alias for modernize-use-equals-default. Implements rule 12.5.1 to explicitly default special member functions.

    +

    This check is an alias for modernize-use-equals-default <../modernize/use-equals-default>. Implements rule 12.5.1 to explicitly default special member functions.

    References

    clang.llvm.org

    ]]> @@ -7875,7 +9780,7 @@ switch(i) {}

    hicpp-use-equals-delete

    -

    This check is an alias for modernize-use-equals-delete. Implements rule 12.5.1 to explicitly default or delete special member functions.

    +

    This check is an alias for modernize-use-equals-delete <../modernize/use-equals-delete>. Implements rule 12.5.1 to explicitly default or delete special member functions.

    References

    clang.llvm.org

    ]]> @@ -7892,7 +9797,7 @@ switch(i) {}

    hicpp-use-noexcept

    -

    The hicpp-use-noexcept check is an alias, please see modernize-use-noexcept for more information. It enforces the rule 1.3.5.

    +

    The hicpp-use-noexcept check is an alias, please see modernize-use-noexcept <../modernize/use-noexcept> for more information. It enforces the rule 1.3.5.

    References

    clang.llvm.org

    ]]> @@ -7909,7 +9814,7 @@ switch(i) {}

    hicpp-use-nullptr

    -

    The hicpp-use-nullptr check is an alias, please see modernize-use-nullptr for more information. It enforces the rule 2.5.3.

    +

    The hicpp-use-nullptr check is an alias, please see modernize-use-nullptr <../modernize/use-nullptr> for more information. It enforces the rule 2.5.3.

    References

    clang.llvm.org

    ]]> @@ -7926,7 +9831,7 @@ switch(i) {}

    hicpp-use-override

    -

    This check is an alias for modernize-use-override. Implements rule 10.2.1 to declare a virtual function override when overriding.

    +

    This check is an alias for modernize-use-override <../modernize/use-override>. Implements rule 10.2.1 to declare a virtual function override when overriding.

    References

    clang.llvm.org

    ]]> @@ -7943,7 +9848,7 @@ switch(i) {}

    hicpp-vararg

    -

    The hicpp-vararg check is an alias, please see cppcoreguidelines-pro-type-vararg for more information. It enforces the rule 14.1.1.

    +

    The hicpp-vararg check is an alias, please see cppcoreguidelines-pro-type-vararg <../cppcoreguidelines/pro-type-vararg> for more information. It enforces the rule 14.1.1.

    References

    clang.llvm.org

    ]]> @@ -7983,7 +9888,7 @@ fn();

    llvm-else-after-return

    -

    The llvm-else-after-return check is an alias, please see readability-else-after-return for more information.

    +

    The llvm-else-after-return check is an alias, please see readability-else-after-return <../readability/else-after-return> for more information.

    References

    clang.llvm.org

    ]]> @@ -8001,6 +9906,7 @@ fn();

    Options

    HeaderFileExtensions

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. Please use the global configuration option HeaderFileExtensions.

    A comma-separated list of filename extensions of header files (the filename extensions should not include "." prefix). Default is "h,hh,hpp,hxx". For header files without an extension, use an empty string (if there are no other desired extensions) or leave an empty element in the list. E.g., "h,hh,hpp,hxx," (note the trailing comma).

    References

    @@ -8128,7 +10034,7 @@ if (X.cast(y)) {}

    llvm-qualified-auto

    -

    The llvm-qualified-auto check is an alias, please see readability-qualified-auto for more information.

    +

    The llvm-qualified-auto check is an alias, please see readability-qualified-auto <../readability/qualified-auto> for more information.

    References

    clang.llvm.org

    ]]> @@ -8161,11 +10067,15 @@ static std::string Moo = (Twine("bark") + "bah").str();clang-tidy - llvmlibc-callee-namespace

    llvmlibc-callee-namespace

    -

    Checks all calls resolve to functions within __llvm_libc namespace.

    -
    namespace __llvm_libc {
    +

    Checks all calls resolve to functions within correct namespace.

    +
    // Implementation inside the LIBC_NAMESPACE namespace.
    +// Correct if:
    +// - LIBC_NAMESPACE is a macro
    +// - LIBC_NAMESPACE expansion starts with `__llvm_libc`
    +namespace LIBC_NAMESPACE {
     
     // Allow calls with the fully qualified name.
    -__llvm_libc::strlen("hello");
    +LIBC_NAMESPACE::strlen("hello");
     
     // Allow calls to compiler provided functions.
     (void)__builtin_abs(-1);
    @@ -8176,7 +10086,7 @@ strlen("world");
     // Disallow calling into functions in the global namespace.
     ::strlen("!");
     
    -} // namespace __llvm_libc
    +} // namespace LIBC_NAMESPACE

    References

    clang.llvm.org

    ]]> @@ -8191,29 +10101,52 @@ strlen("world");

    llvmlibc-implementation-in-namespace

    Checks that all declarations in the llvm-libc implementation are within the correct namespace.

    -
    // Correct: implementation inside the correct namespace.
    -namespace __llvm_libc {
    +
    // Implementation inside the LIBC_NAMESPACE namespace.
    +// Correct if:
    +// - LIBC_NAMESPACE is a macro
    +// - LIBC_NAMESPACE expansion starts with `__llvm_libc`
    +namespace LIBC_NAMESPACE {
         void LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {}
    -    // Namespaces within __llvm_libc namespace are allowed.
    -    namespace inner{
    +    // Namespaces within LIBC_NAMESPACE namespace are allowed.
    +    namespace inner {
             int localVar = 0;
         }
         // Functions with C linkage are allowed.
    -    extern "C" void str_fuzz(){}
    +    extern "C" void str_fuzz() {}
     }
     
    -// Incorrect: implementation not in a namespace.
    +// Incorrect: implementation not in the LIBC_NAMESPACE namespace.
     void LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {}
     
    -// Incorrect: outer most namespace is not correct.
    +// Incorrect: outer most namespace is not the LIBC_NAMESPACE macro.
     namespace something_else {
         void LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {}
    +}
    +
    +// Incorrect: outer most namespace expansion does not start with `__llvm_libc`.
    +#define LIBC_NAMESPACE custom_namespace
    +namespace LIBC_NAMESPACE {
    +    void LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {}
     }

    References

    clang.llvm.org

    ]]> INFO + + llvmlibc-inline-function-decl + llvmlibc-inline-function-decl + + +

    clang-tidy - llvmlibc-inline-function-decl

    + +

    llvmlibc-inline-function-decl

    +

    Checks that all implicitly and explicitly inline functions in header files are tagged with the LIBC_INLINE macro, except for functions implicit to classes or deleted functions. See the libc style guide for more information about this macro.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    llvmlibc-restrict-system-libc-headers llvmlibc-restrict-system-libc-headers @@ -8240,78 +10173,304 @@ namespace something_else { INFO - misc-definitions-in-headers - misc-definitions-in-headers + misc-confusable-identifiers + misc-confusable-identifiers -

    clang-tidy - misc-definitions-in-headers

    +

    clang-tidy - misc-confusable-identifiers

    -

    misc-definitions-in-headers

    -

    Finds non-extern non-inline function and variable definitions in header files, which can lead to potential ODR violations in case these headers are included from multiple translation units.

    -
    // Foo.h
    -int a = 1; // Warning: variable definition.
    -extern int d; // OK: extern variable.
    -
    -namespace N {
    -  int e = 2; // Warning: variable definition.
    -}
    +

    misc-confusable-identifiers

    +

    Warn about confusable identifiers, i.e. identifiers that are visually close to each other, but use different Unicode characters. This detects a potential attack described in CVE-2021-42574.

    +

    Example:

    +
    int fo; // Initial character is U+0066 (LATIN SMALL LETTER F).
    +int fo; // Initial character is U+1D41F (MATHEMATICAL BOLD SMALL F) not U+0066 (LATIN SMALL LETTER F).
    +

    References

    +

    clang.llvm.org

    ]]> + + INFO + + + misc-const-correctness + misc-const-correctness + + +

    clang-tidy - misc-const-correctness

    + +

    misc-const-correctness

    +

    This check implements detection of local variables which could be declared as const but are not. Declaring variables as const is required or recommended by many coding guidelines, such as: ES.25 from the C++ Core Guidelines and AUTOSAR C++14 Rule A7-1-1 (6.7.1 Specifiers).

    +

    Please note that this check's analysis is type-based only. Variables that are not modified but used to create a non-const handle that might escape the scope are not diagnosed as potential const.

    +
    // Declare a variable, which is not ``const`` ...
    +int i = 42;
    +// but use it as read-only. This means that `i` can be declared ``const``.
    +int result = i * i;       // Before transformation
    +int const result = i * i; // After transformation
    +

    The check can analyze values, pointers and references but not (yet) pointees:

    +
    // Normal values like built-ins or objects.
    +int potential_const_int = 42;       // Before transformation
    +int const potential_const_int = 42; // After transformation
    +int copy_of_value = potential_const_int;
     
    -// Warning: variable definition.
    -const char* str = "foo";
    +MyClass could_be_const;       // Before transformation
    +MyClass const could_be_const; // After transformation
    +could_be_const.const_qualified_method();
     
    -// OK: internal linkage variable definitions are ignored for now.
    -// Although these might also cause ODR violations, we can be less certain and
    -// should try to keep the false-positive rate down.
    -static int b = 1;
    -const int c = 1;
    -const char* const str2 = "foo";
    -constexpr int k = 1;
    +// References can be declared const as well.
    +int &reference_value = potential_const_int;       // Before transformation
    +int const& reference_value = potential_const_int; // After transformation
    +int another_copy = reference_value;
     
    -// Warning: function definition.
    -int g() {
    -  return 1;
    -}
    +// The similar semantics of pointers are not (yet) analyzed.
    +int *pointer_variable = &potential_const_int; // _NO_ 'const int *pointer_variable' suggestion.
    +int last_copy = *pointer_variable;
    +

    The automatic code transformation is only applied to variables that are declared in single declarations. You may want to prepare your code base with readability-isolate-declaration <../readability/isolate-declaration> first.

    +

    Note that there is the check cppcoreguidelines-avoid-non-const-global-variables <../cppcoreguidelines/avoid-non-const-global-variables> to enforce const correctness on all globals.

    +

    Known Limitations

    +

    The check does not run on C code.

    +

    The check will not analyze templated variables or variables that are instantiation dependent. Different instantiations can result in different const correctness properties and in general it is not possible to find all instantiations of a template. The template might be used differently in an independent translation unit.

    +

    Pointees can not be analyzed for constness yet. The following code shows this limitation.

    +
    // Declare a variable that will not be modified.
    +int constant_value = 42;
     
    -// OK: inline function definition is allowed to be defined multiple times.
    -inline int e() {
    -  return 1;
    -}
    +// Declare a pointer to that variable, that does not modify either, but misses 'const'.
    +// Could be 'const int *pointer_to_constant = &constant_value;'
    +int *pointer_to_constant = &constant_value;
     
    -class A {
    -public:
    -  int f1() { return 1; } // OK: implicitly inline member function definition is allowed.
    -  int f2();
    +// Usage:
    +int result = 520 * 120 * (*pointer_to_constant);
    +

    This limitation affects the capability to add const to methods which is not possible, too.

    +

    Options

    +
    +

    AnalyzeValues (default = true)

    +

    Enable or disable the analysis of ordinary value variables, like int i = 42;

    +
    // Warning
    +int i = 42;
    +// No warning
    +int const i = 42;
     
    -  static int d;
    -};
    +// Warning
    +int a[] = {42, 42, 42};
    +// No warning
    +int const a[] = {42, 42, 42};
    +
    +
    +

    AnalyzeReferences (default = true)

    +

    Enable or disable the analysis of reference variables, like int &ref = i;

    +
    int i = 42;
    +// Warning
    +int& ref = i;
    +// No warning
    +int const& ref = i;
    +
    +
    +

    WarnPointersAsValues (default = false)

    +

    This option enables the suggestion for const of the pointer itself. Pointer values have two possibilities to be const, the pointer and the value pointing to.

    +
    int value = 42;
     
    -// Warning: not an inline member function definition.
    -int A::f2() { return 1; }
    +// Warning
    +const int * pointer_variable = &value;
    +// No warning
    +const int *const pointer_variable = &value;
    +
    +
    +

    TransformValues (default = true)

    +

    Provides fixit-hints for value types that automatically add const if its a single declaration.

    +
    // Before
    +int value = 42;
    +// After
    +int const value = 42;
     
    -// OK: class static data member declaration is allowed.
    -int A::d = 1;
    +// Before
    +int a[] = {42, 42, 42};
    +// After
    +int const a[] = {42, 42, 42};
     
    -// OK: function template is allowed.
    -template<typename T>
    -T f3() {
    -  T a = 1;
    -  return a;
    -}
    +// Result is modified later in its life-time. No diagnostic and fixit hint will be emitted.
    +int result = value * 3;
    +result -= 10;
    +
    +
    +

    TransformReferences (default = true)

    +

    Provides fixit-hints for reference types that automatically add const if its a single declaration.

    +
    // This variable could still be a constant. But because there is a non-const reference to
    +// it, it can not be transformed (yet).
    +int value = 42;
    +// The reference 'ref_value' is not modified and can be made 'const int &ref_value = value;'
    +// Before
    +int &ref_value = value;
    +// After
    +int const &ref_value = value;
     
    -// Warning: full specialization of a function template is not allowed.
    -template <>
    -int f3() {
    -  int a = 1;
    -  return a;
    -}
    +// Result is modified later in its life-time. No diagnostic and fixit hint will be emitted.
    +int result = ref_value * 3;
    +result -= 10;
    +
    +
    +

    TransformPointersAsValues (default = false)

    +

    Provides fixit-hints for pointers if their pointee is not changed. This does not analyze if the value-pointed-to is unchanged!

    +

    Requires 'WarnPointersAsValues' to be 'true'.

    +
    int value = 42;
     
    -template <typename T>
    -struct B {
    -  void f1();
    -};
    +// Before
    +const int * pointer_variable = &value;
    +// After
    +const int *const pointer_variable = &value;
     
    -// OK: member function definition of a class template is allowed.
    -template <typename T>
    +// Before
    +const int * a[] = {&value, &value};
    +// After
    +const int *const a[] = {&value, &value};
    +
    +// Before
    +int *ptr_value = &value;
    +// After
    +int *const ptr_value = &value;
    +
    +int result = 100 * (*ptr_value); // Does not modify the pointer itself.
    +// This modification of the pointee is still allowed and not diagnosed.
    +*ptr_value = 0;
    +
    +// The following pointer may not become a 'int *const'.
    +int *changing_pointee = &value;
    +changing_pointee = &result;
    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + misc-coroutine-hostile-raii + misc-coroutine-hostile-raii + + +

    clang-tidy - misc-coroutine-hostile-raii

    + +

    misc-coroutine-hostile-raii

    +

    Detects when objects of certain hostile RAII types persists across suspension points in a coroutine. Such hostile types include scoped-lockable types and types belonging to a configurable denylist.

    +

    Some objects require that they be destroyed on the same thread that created them. Traditionally this requirement was often phrased as "must be a local variable", under the assumption that local variables always work this way. However this is incorrect with C++20 coroutines, since an intervening co_await may cause the coroutine to suspend and later be resumed on another thread.

    +

    The lifetime of an object that requires being destroyed on the same thread must not encompass a co_await or co_yield point. If you create/destroy an object, you must do so without allowing the coroutine to suspend in the meantime.

    +

    Following types are considered as hostile:

    +
    +
      +
    • Scoped-lockable types: A scoped-lockable object persisting across a suspension point is problematic as the lock held by this object could be unlocked by a different thread. This would be undefined behaviour. This includes all types annotated with the scoped_lockable attribute.
    • +
    • Types belonging to a configurable denylist.
    • +
    +
    +
    // Call some async API while holding a lock.
    +task coro() {
    +  const std::lock_guard l(&mu_);
    +
    +  // Oops! The async Bar function may finish on a different
    +  // thread from the one that created the lock_guard (and called
    +  // Mutex::Lock). After suspension, Mutex::Unlock will be called on the wrong thread.
    +  co_await Bar();
    +}
    +

    Options

    +
    +

    RAIITypesList

    +

    A semicolon-separated list of qualified types which should not be allowed to persist across suspension points. Eg: my::lockable; a::b;::my::other::lockable; The default value of this option is "std::lock_guard;std::scoped_lock".

    +
    +
    +

    AllowedAwaitablesList

    +

    A semicolon-separated list of qualified types of awaitables types which can be safely awaited while having hostile RAII objects in scope.

    +

    co_await-ing an expression of awaitable type is considered safe if the awaitable type is part of this list. RAII objects persisting across such a co_await expression are considered safe and hence are not flagged.

    +

    Example usage:

    +
    // Consider option AllowedAwaitablesList = "safe_awaitable"
    +struct safe_awaitable {
    +  bool await_ready() noexcept { return false; }
    +  void await_suspend(std::coroutine_handle<>) noexcept {}
    +  void await_resume() noexcept {}
    +};
    +auto wait() { return safe_awaitable{}; }
    +
    +task coro() {
    +  // This persists across both the co_await's but is not flagged
    +  // because the awaitable is considered safe to await on.
    +  const std::lock_guard l(&mu_);
    +  co_await safe_awaitable{};
    +  co_await wait();
    +}
    +

    Eg: my::safe::awaitable;other::awaitable The default value of this option is empty string "".

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + misc-definitions-in-headers + misc-definitions-in-headers + + +

    clang-tidy - misc-definitions-in-headers

    + +

    misc-definitions-in-headers

    +

    Finds non-extern non-inline function and variable definitions in header files, which can lead to potential ODR violations in case these headers are included from multiple translation units.

    +
    // Foo.h
    +int a = 1; // Warning: variable definition.
    +extern int d; // OK: extern variable.
    +
    +namespace N {
    +  int e = 2; // Warning: variable definition.
    +}
    +
    +// Warning: variable definition.
    +const char* str = "foo";
    +
    +// OK: internal linkage variable definitions are ignored for now.
    +// Although these might also cause ODR violations, we can be less certain and
    +// should try to keep the false-positive rate down.
    +static int b = 1;
    +const int c = 1;
    +const char* const str2 = "foo";
    +constexpr int k = 1;
    +namespace { int x = 1; }
    +
    +// Warning: function definition.
    +int g() {
    +  return 1;
    +}
    +
    +// OK: inline function definition is allowed to be defined multiple times.
    +inline int e() {
    +  return 1;
    +}
    +
    +class A {
    +public:
    +  int f1() { return 1; } // OK: implicitly inline member function definition is allowed.
    +  int f2();
    +
    +  static int d;
    +};
    +
    +// Warning: not an inline member function definition.
    +int A::f2() { return 1; }
    +
    +// OK: class static data member declaration is allowed.
    +int A::d = 1;
    +
    +// OK: function template is allowed.
    +template<typename T>
    +T f3() {
    +  T a = 1;
    +  return a;
    +}
    +
    +// Warning: full specialization of a function template is not allowed.
    +template <>
    +int f3() {
    +  int a = 1;
    +  return a;
    +}
    +
    +template <typename T>
    +struct B {
    +  void f1();
    +};
    +
    +// OK: member function definition of a class template is allowed.
    +template <typename T>
     void B<T>::f1() {}
     
     class CE {
    @@ -8325,13 +10484,16 @@ constexpr int f10() { return 0; } // OK: constexpr function implies inline.
     // OK: C++14 variable templates are inline.
     template <class T>
     constexpr T pi = T(3.1415926L);
    +

    When clang-tidy is invoked with the --fix-notes option, this check provides fixes that automatically add the inline keyword to discovered functions. Please note that the addition of the inline keyword to variables is not currently supported by this check.

    Options

    HeaderFileExtensions

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. Please use the global configuration option HeaderFileExtensions.

    A comma-separated list of filename extensions of header files (the filename extensions should not include "." prefix). Default is "h,hh,hpp,hxx". For header files without an extension, use an empty string (if there are no other desired extensions) or leave an empty element in the list. E.g., "h,hh,hpp,hxx," (note the trailing comma).

    UseHeaderFileExtension

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. The check will unconditionally use the global option HeaderFileExtensions.

    When true, the check will use the file extension to distinguish header files. Default is true.

    References

    @@ -8339,6 +10501,80 @@ constexpr T pi = T(3.1415926L);
    MINOR
    + + misc-header-include-cycle + misc-header-include-cycle + + +

    clang-tidy - misc-header-include-cycle

    + +

    misc-header-include-cycle

    +

    Check detects cyclic #include dependencies between user-defined headers.

    +
    // Header A.hpp
    +#pragma once
    +#include "B.hpp"
    +
    +// Header B.hpp
    +#pragma once
    +#include "C.hpp"
    +
    +// Header C.hpp
    +#pragma once
    +#include "A.hpp"
    +
    +// Include chain: A->B->C->A
    +

    Header files are a crucial part of many C++ programs as they provide a way to organize declarations and definitions shared across multiple source files. However, header files can also create problems when they become entangled in complex dependency cycles. Such cycles can cause issues with compilation times, unnecessary rebuilds, and make it harder to understand the overall structure of the code.

    +

    To address these issues, a check has been developed to detect cyclic dependencies between header files, also known as "include cycles". An include cycle occurs when a header file A includes header file B, and B (or any subsequent included header file) includes back header file A, resulting in a circular dependency cycle.

    +

    This check operates at the preprocessor level and specifically analyzes user-defined headers and their dependencies. It focuses solely on detecting include cycles while disregarding other types or function dependencies. This specialized analysis helps identify and prevent issues related to header file organization.

    +

    By detecting include cycles early in the development process, developers can identify and resolve these issues before they become more difficult and time-consuming to fix. This can lead to faster compile times, improved code quality, and a more maintainable codebase overall. Additionally, by ensuring that header files are organized in a way that avoids cyclic dependencies, developers can make their code easier to understand and modify over time.

    +

    It's worth noting that only user-defined headers their dependencies are analyzed, System includes such as standard library headers and third-party library headers are excluded. System includes are usually well-designed and free of include cycles, and ignoring them helps to focus on potential issues within the project's own codebase. This limitation doesn't diminish the ability to detect #include cycles within the analyzed code.

    +

    Developers should carefully review any warnings or feedback provided by this solution. While the analysis aims to identify and prevent include cycles, there may be situations where exceptions or modifications are necessary. It's important to exercise judgment and consider the specific context of the codebase when making adjustments.

    +

    Options

    +
    +

    IgnoredFilesList

    +

    Provides a way to exclude specific files/headers from the warnings raised by a check. This can be achieved by specifying a semicolon-separated list of regular expressions or filenames. This option can be used as an alternative to //NOLINT when using it is not possible. The default value of this option is an empty string, indicating that no files are ignored by default.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + misc-include-cleaner + misc-include-cleaner + + +

    clang-tidy - misc-include-cleaner

    + +

    misc-include-cleaner

    +

    Checks for unused and missing includes. Generates findings only for the main file of a translation unit. Findings correspond to https://clangd.llvm.org/design/include-cleaner.

    +

    Example:

    +
    // foo.h
    +class Foo{};
    +// bar.h
    +#include "baz.h"
    +class Bar{};
    +// baz.h
    +class Baz{};
    +// main.cc
    +#include "bar.h" // OK: uses class Bar from bar.h
    +#include "foo.h" // warning: unused include "foo.h"
    +Bar bar;
    +Baz baz; // warning: missing include "baz.h"
    +

    Options

    +
    +

    IgnoreHeaders

    +

    A semicolon-separated list of regexes to disable insertion/removal of header files that match this regex as a suffix. E.g., foo/.* disables insertion/removal for all headers under the directory foo. By default, no headers will be ignored.

    +
    +
    +

    DeduplicateFindings

    +

    A boolean that controls whether the check should deduplicate findings for the same symbol. Defaults to true.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    misc-misleading-bidirectional misc-misleading-bidirectional @@ -8589,6 +10825,7 @@ void f(const int_ptr ptr) {
  • The operator must always return *this.
  • +

    This check implements AUTOSAR C++14 Rule A13-2-1.

    References

    clang.llvm.org

    ]]> @@ -8662,6 +10899,10 @@ static void staticFunctionA() { /*some code that doesn't use `i`*/ }
    <

    StrictMode

    When false (default value), the check will ignore trivially unused parameters, i.e. when the corresponding function has an empty body (and in case of constructors - no constructor initializers). When the function body is empty, an unused parameter is unlikely to be unnoticed by a human reader, and there's basically no place for a bug to hide.

    +
    +

    IgnoreVirtual

    +

    Determines whether virtual method parameters should be inspected. Set to true to ignore them. Default is false.

    +

    References

    clang.llvm.org

    ]]> @@ -8676,14 +10917,59 @@ static void staticFunctionA() { /*some code that doesn't use `i`*/ }<

    misc-unused-using-decls

    Finds unused using declarations.

    +

    Unused using declarations in header files will not be diagnosed since these using declarations are part of the header's public API. Allowed header file extensions can be configured via the `HeaderFileExtensions option (see below).

    Example:

    -
    namespace n { class C; }
    +
    // main.cpp
    +namespace n { class C; }
     using n::C;  // Never actually used.
    +

    Options

    +
    +

    HeaderFileExtensions

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. Please use the global configuration option HeaderFileExtensions.

    +

    A semicolon-separated list of filename extensions of header files (the filename extensions should not include "." prefix). Default is "h,hh,hpp,hxx". For extension-less header files, use an empty string or leave an empty string between "," if there are other filename extensions.

    +

    References

    clang.llvm.org

    ]]> INFO + + misc-use-anonymous-namespace + misc-use-anonymous-namespace + + +

    clang-tidy - misc-use-anonymous-namespace

    + +

    misc-use-anonymous-namespace

    +

    Finds instances of static functions or variables declared at global scope that could instead be moved into an anonymous namespace.

    +

    Anonymous namespaces are the "superior alternative" according to the C++ Standard. static was proposed for deprecation, but later un-deprecated to keep C compatibility [1]. static is an overloaded term with different meanings in different contexts, so it can create confusion.

    +

    The following uses of static will not be diagnosed:

    +
      +
    • Functions or variables in header files, since anonymous namespaces in headers is considered an antipattern. Allowed header file extensions can be configured via the HeaderFileExtensions option (see below).
    • +
    • const or constexpr variables, since they already have implicit internal linkage in C++.
    • +
    +

    Examples:

    +
    // Bad
    +static void foo();
    +static int x;
    +
    +// Good
    +namespace {
    +  void foo();
    +  int x;
    +} // namespace
    +

    Options

    +
    +

    HeaderFileExtensions

    +

    Note: this option is deprecated, it will be removed in clang-tidy version 19. Please use the global configuration option HeaderFileExtensions.

    +

    A semicolon-separated list of filename extensions of header files (the filename extensions should not include "." prefix). Default is ";h;hh;hpp;hxx". For extension-less header files, using an empty string or leaving an empty string between ";" if there are other filename extensions.

    +
    +

    [1] Undeprecating static

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    modernize-avoid-bind modernize-avoid-bind @@ -8814,6 +11100,13 @@ namespace n7 { void t(); } } +} + +// in c++20 +namespace n8 { +inline namespace n9 { +void t(); +} }

    Will be modified to:

    namespace n1::n2 {
    @@ -8827,6 +11120,11 @@ void t();
     namespace n6::n7 {
     void t();
     }
    +}
    +
    +// in c++20
    +namespace n8::inline n9 {
    +void t();
     }

    References

    clang.llvm.org

    ]]> @@ -8991,8 +11289,20 @@ for (int i = 0; i < N; ++i) for (vector<int>::iterator it = v.begin(); it != v.end(); ++it) cout << *it; +// reasonable conversion +for (vector<int>::iterator it = begin(v); it != end(v); ++it) + cout << *it; + +// reasonable conversion +for (vector<int>::iterator it = std::begin(v); it != std::end(v); ++it) + cout << *it; + // reasonable conversion for (int i = 0; i < v.size(); ++i) + cout << v[i]; + +// reasonable conversion +for (int i = 0; i < size(v); ++i) cout << v[i];

    After applying the check with minimum confidence level set to reasonable (default):

    const int N = 5;
    @@ -9110,43 +11420,101 @@ for (vector<int>::iterator it = vec.begin(), e = vec.end(); it != e; ++it)
         MINOR
         
       
    -    modernize-make-shared
    -    modernize-make-shared
    +    modernize-macro-to-enum
    +    modernize-macro-to-enum
         
           
    -

    clang-tidy - modernize-make-shared

    - -

    modernize-make-shared

    -

    This check finds the creation of std::shared_ptr objects by explicitly calling the constructor and a new expression, and replaces it with a call to std::make_shared.

    -
    auto my_ptr = std::shared_ptr<MyPair>(new MyPair(1, 2));
    -
    -// becomes
    -
    -auto my_ptr = std::make_shared<MyPair>(1, 2);
    -

    This check also finds calls to std::shared_ptr::reset() with a new expression, and replaces it with a call to std::make_shared.

    -
    my_ptr.reset(new MyPair(1, 2));
    -
    -// becomes
    -
    -my_ptr = std::make_shared<MyPair>(1, 2);
    -

    Options

    -
    -

    MakeSmartPtrFunction

    -

    A string specifying the name of make-shared-ptr function. Default is std::make_shared.

    -
    -
    -

    MakeSmartPtrFunctionHeader

    -

    A string specifying the corresponding header of make-shared-ptr function. Default is memory.

    +

    clang-tidy - modernize-macro-to-enum

    -
    -

    IncludeStyle

    -

    A string specifying which include-style is used, llvm or google. Default is llvm.

    +

    modernize-macro-to-enum

    +

    Replaces groups of adjacent macros with an unscoped anonymous enum. Using an unscoped anonymous enum ensures that everywhere the macro token was used previously, the enumerator name may be safely used.

    +

    This check can be used to enforce the C++ core guideline Enum.1: Prefer enumerations over macros, within the constraints outlined below.

    +

    Potential macros for replacement must meet the following constraints:

    +
      +
    • Macros must expand only to integral literal tokens or expressions of literal tokens. The expression may contain any of the unary operators -, +, ~ or !, any of the binary operators ,, -, +, *, /, %, &, |, ^, <, >, <=, >=, ==, !=, ||, &&, <<, >> or <=>, the ternary operator ?: and its GNU extension. Parenthesized expressions are also recognized. This recognizes most valid expressions. In particular, expressions with the sizeof operator are not recognized.
    • +
    • Macros must be defined on sequential source file lines, or with only comment lines in between macro definitions.
    • +
    • Macros must all be defined in the same source file.
    • +
    • Macros must not be defined within a conditional compilation block. (Conditional include guards are exempt from this constraint.)
    • +
    • Macros must not be defined adjacent to other preprocessor directives.
    • +
    • Macros must not be used in any conditional preprocessing directive.
    • +
    • Macros must not be used as arguments to other macros.
    • +
    • Macros must not be undefined.
    • +
    • Macros must be defined at the top-level, not inside any declaration or definition.
    • +
    +

    Each cluster of macros meeting the above constraints is presumed to be a set of values suitable for replacement by an anonymous enum. From there, a developer can give the anonymous enum a name and continue refactoring to a scoped enum if desired. Comments on the same line as a macro definition or between subsequent macro definitions are preserved in the output. No formatting is assumed in the provided replacements, although clang-tidy can optionally format all fixes.

    +
    +
    +

    Warning

    -
    -

    IgnoreMacros

    -

    If set to true, the check will not give warnings inside macros. Default is true.

    +

    Initializing expressions are assumed to be valid initializers for an enum. C requires that enum values fit into an int, but this may not be the case for some accepted constant expressions. For instance 1 << 40 will not fit into an int when the size of an int is 32 bits.

    -
    +

    Examples:

    +
    #define RED   0xFF0000
    +#define GREEN 0x00FF00
    +#define BLUE  0x0000FF
    +
    +#define TM_NONE (-1) // No method selected.
    +#define TM_ONE 1    // Use tailored method one.
    +#define TM_TWO 2    // Use tailored method two.  Method two
    +                    // is preferable to method one.
    +#define TM_THREE 3  // Use tailored method three.
    +

    becomes

    +
    enum {
    +RED = 0xFF0000,
    +GREEN = 0x00FF00,
    +BLUE = 0x0000FF
    +};
    +
    +enum {
    +TM_NONE = (-1), // No method selected.
    +TM_ONE = 1,    // Use tailored method one.
    +TM_TWO = 2,    // Use tailored method two.  Method two
    +                    // is preferable to method one.
    +TM_THREE = 3  // Use tailored method three.
    +};
    +

    References

    +

    clang.llvm.org

    ]]> + + INFO + + + modernize-make-shared + modernize-make-shared + + +

    clang-tidy - modernize-make-shared

    +
    +

    modernize-make-shared

    +

    This check finds the creation of std::shared_ptr objects by explicitly calling the constructor and a new expression, and replaces it with a call to std::make_shared.

    +
    auto my_ptr = std::shared_ptr<MyPair>(new MyPair(1, 2));
    +
    +// becomes
    +
    +auto my_ptr = std::make_shared<MyPair>(1, 2);
    +

    This check also finds calls to std::shared_ptr::reset() with a new expression, and replaces it with a call to std::make_shared.

    +
    my_ptr.reset(new MyPair(1, 2));
    +
    +// becomes
    +
    +my_ptr = std::make_shared<MyPair>(1, 2);
    +

    Options

    +
    +

    MakeSmartPtrFunction

    +

    A string specifying the name of make-shared-ptr function. Default is std::make_shared.

    +
    +
    +

    MakeSmartPtrFunctionHeader

    +

    A string specifying the corresponding header of make-shared-ptr function. Default is memory.

    +
    +
    +

    IncludeStyle

    +

    A string specifying which include-style is used, llvm or google. Default is llvm.

    +
    +
    +

    IgnoreMacros

    +

    If set to true, the check will not give warnings inside macros. Default is true.

    +
    +

    IgnoreDefaultInitialization

    If set to non-zero, the check does not suggest edits that will transform default initialization into value initialization, as this can cause performance regressions. Default is 1.

    @@ -9346,6 +11714,14 @@ const char *const RegEx{R"(\w\([a-z]\))"};

    The presence of any of the following escapes can cause the string to be converted to a raw string literal: \\, \', \", \?, and octal or hexadecimal escapes for printable ASCII characters.

    A string literal containing only escaped newlines is a common way of writing lines of text output. Introducing physical newlines with raw string literals in this case is likely to impede readability. These string literals are left unchanged.

    An escaped horizontal tab, form feed, or vertical tab prevents the string literal from being converted. The presence of a horizontal tab, form feed or vertical tab in source code is not visually obvious.

    +
    +

    DelimiterStem

    +

    Custom delimiter to escape characters in raw string literals. It is used in the following construction: R"stem_delimiter(contents)stem_delimiter". The default value is lit.

    +
    +
    +

    ReplaceShorterLiterals

    +

    Controls replacing shorter non-raw string literals with longer raw string literals. Setting this option to true enables the replacement. The default value is false (shorter literals are not replaced).

    +

    References

    clang.llvm.org

    ]]> @@ -9574,6 +11950,38 @@ Foo bar() { INFO
    + + modernize-type-traits + modernize-type-traits + + +

    clang-tidy - modernize-type-traits

    + +

    modernize-type-traits

    +

    Converts standard library type traits of the form traits<...>::type and traits<...>::value into traits_t<...> and traits_v<...> respectively.

    +

    For example:

    +
    std::is_integral<T>::value
    +std::is_same<int, float>::value
    +typename std::add_const<T>::type
    +std::make_signed<unsigned>::type
    +

    Would be converted into:

    +
    std::is_integral_v<T>
    +std::is_same_v<int, float>
    +std::add_const_t<T>
    +std::make_signed_t<unsigned>
    +

    Options

    +
    +

    IgnoreMacros

    +

    If true don't diagnose traits defined in macros.

    +

    Note: Fixes will never be emitted for code inside of macros.

    +
    #define IS_SIGNED(T) std::is_signed<T>::value
    +

    Defaults to false.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    modernize-unary-static-assert modernize-unary-static-assert @@ -9788,6 +12196,63 @@ bool x = p ? true : false; MINOR + + modernize-use-constraints + modernize-use-constraints + + +

    clang-tidy - modernize-use-constraints

    + +

    modernize-use-constraints

    +

    Replace std::enable_if with C++20 requires clauses.

    +

    std::enable_if is a SFINAE mechanism for selecting the desired function or class template based on type traits or other requirements. enable_if changes the meta-arity of the template, and has other adverse side effects in the code. C++20 introduces concepts and constraints as a cleaner language provided solution to achieve the same outcome.

    +

    This check finds some common std::enable_if patterns that can be replaced by C++20 requires clauses. The tool can replace some of these patterns automatically, otherwise, the tool will emit a diagnostic without a replacement. The tool can detect the following std::enable_if patterns

    +
      +
    1. std::enable_if in the return type of a function
    2. +
    3. std::enable_if as the trailing template parameter for function templates
    4. +
    +

    Other uses, for example, in class templates for function parameters, are not currently supported by this tool. Other variants such as boost::enable_if are not currently supported by this tool.

    +

    Below are some examples of code using std::enable_if.

    +
    // enable_if in function return type
    +template <typename T>
    +std::enable_if_t<T::some_trait, int> only_if_t_has_the_trait() { ... }
    +
    +// enable_if in the trailing template parameter
    +template <typename T, std::enable_if_t<T::some_trait, int> = 0>
    +void another_version() { ... }
    +
    +template <typename T>
    +typename std::enable_if<T::some_value, Obj>::type existing_constraint() requires (T::another_value) {
    +  return Obj{};
    +}
    +
    +template <typename T, std::enable_if_t<T::some_trait, int> = 0>
    +struct my_class {};
    +

    The tool will replace the above code with,

    +
    // warning: use C++20 requires constraints instead of enable_if [modernize-use-constraints]
    +template <typename T>
    +int only_if_t_has_the_trait() requires T::some_trait { ... }
    +
    +// warning: use C++20 requires constraints instead of enable_if [modernize-use-constraints]
    +template <typename T>
    +void another_version() requires T::some_trait { ... }
    +
    +// The tool will emit a diagnostic for the following, but will
    +// not attempt to replace the code.
    +// warning: use C++20 requires constraints instead of enable_if [modernize-use-constraints]
    +template <typename T>
    +typename std::enable_if<T::some_value, Obj>::type existing_constraint() requires (T::another_value) {
    +  return Obj{};
    +}
    +
    +// The tool will not emit a diagnostic or attempt to replace the code.
    +template <typename T, std::enable_if_t<T::some_trait, int> = 0>
    +struct my_class {};
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    modernize-use-default-member-init modernize-use-default-member-init @@ -9842,8 +12307,7 @@ struct A { modernize-use-default modernize-use-default - +
    orphan
    @@ -9855,7 +12319,7 @@ struct A {

    modernize-use-default

    -

    This check has been renamed to modernize-use-equals-default.

    +

    This check has been renamed to modernize-use-equals-default <../modernize/use-equals-default>.

    References

    clang.llvm.org

    ]]>
    @@ -10002,7 +12466,7 @@ A::~A() = default;

    Options

    IgnoreMacros

    -

    If set to true, the check will not give warnings inside macros. Default is true.

    +

    If set to true, the check will not give warnings inside macros and will ignore special members with bodies contain macros or preprocessor directives. Default is true.

    References

    clang.llvm.org

    ]]> @@ -10017,17 +12481,20 @@ A::~A() = default;

    clang-tidy - modernize-use-equals-delete

    modernize-use-equals-delete

    -

    This check marks unimplemented private special member functions with = delete. To avoid false-positives, this check only applies in a translation unit that has all other member functions implemented.

    -
    struct A {
    -private:
    +

    Identifies unimplemented private special member functions, and recommends using = delete for them. Additionally, it recommends relocating any deleted member function from the private to the public section.

    +

    Before the introduction of C++11, the primary method to effectively "erase" a particular function involved declaring it as private without providing a definition. This approach would result in either a compiler error (when attempting to call a private function) or a linker error (due to an undefined reference).

    +

    However, subsequent to the advent of C++11, a more conventional approach emerged for achieving this purpose. It involves flagging functions as = delete and keeping them in the public section of the class.

    +

    To prevent false positives, this check is only active within a translation unit where all other member functions have been implemented. The check will generate partial fixes by introducing = delete, but the user is responsible for manually relocating functions to the public section.

    +
    // Example: bad
    +class A {
    + private:
       A(const A&);
       A& operator=(const A&);
     };
     
    -// becomes
    -
    -struct A {
    -private:
    +// Example: good
    +class A {
    + public:
       A(const A&) = delete;
       A& operator=(const A&) = delete;
     };
    @@ -10188,6 +12655,10 @@ int *ret_ptr() { }

    Options

    +

    IgnoredTypes

    +

    Semicolon-separated list of regular expressions to match pointer types for which implicit casts will be ignored. Default value: std::_CmpUnspecifiedParam::;^std::__cmp_cat::__unspec.

    +
    +

    NullMacros

    Comma-separated list of macro names that will be transformed along with NULL. By default this check will only replace the NULL macro and will skip any similar user-defined macros.

    @@ -10231,6 +12702,10 @@ void assignment() {

    If set to true, this check will not diagnose destructors. Default is false.

    +

    IgnoreTemplateInstantiations

    +

    If set to true, instructs this check to ignore virtual function overrides that are part of template instantiations. Default is false.

    +
    +

    AllowOverrideAndFinal

    If set to true, this check will not diagnose override as redundant with final. This is useful when code will be compiled by a compiler with warning/error checking flags requiring override explicitly on overridden members, such as gcc -Wsuggest-override/gcc -Werror=suggest-override. Default is false.

    @@ -10253,6 +12728,159 @@ void assignment() { INFO
    + + modernize-use-starts-ends-with + modernize-use-starts-ends-with + + +

    clang-tidy - modernize-use-starts-ends-with

    + +

    modernize-use-starts-ends-with

    +

    Checks whether a find or rfind result is compared with 0 and suggests replacing with starts_with when the method exists in the class. Notably, this will work with std::string and std::string_view.

    +
    std::string s = "...";
    +if (s.find("prefix") == 0) { /* do something */ }
    +if (s.rfind("prefix", 0) == 0) { /* do something */ }
    +

    becomes

    +
    std::string s = "...";
    +if (s.starts_with("prefix")) { /* do something */ }
    +if (s.starts_with("prefix")) { /* do something */ }
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + modernize-use-std-numbers + modernize-use-std-numbers + + +

    clang-tidy - modernize-use-std-numbers

    + +

    modernize-use-std-numbers

    +

    Finds constants and function calls to math functions that can be replaced with C++20's mathematical constants from the numbers header and offers fix-it hints. Does not match the use of variables with that value, and instead, offers a replacement for the definition of those variables. Function calls that match the pattern of how the constant is calculated are matched and replaced with the std::numbers constant. The use of macros gets replaced with the corresponding std::numbers constant, instead of changing the macro definition.

    +

    The following list of constants from the numbers header are supported:

    +
      +
    • e
    • +
    • log2e
    • +
    • log10e
    • +
    • pi
    • +
    • inv_pi
    • +
    • inv_sqrtpi
    • +
    • ln2
    • +
    • ln10
    • +
    • sqrt2
    • +
    • sqrt3
    • +
    • inv_sqrt3
    • +
    • egamma
    • +
    • phi
    • +
    +

    The list currently includes all constants as of C++20.

    +

    The replacements use the type of the matched constant and can remove explicit casts, i.e., switching between std::numbers::e, std::numbers::e_v<float> and std::numbers::e_v<long double> where appropriate.

    +
    double sqrt(double);
    +double log2(double);
    +void sink(auto&&) {}
    +void floatSink(float);
    +
    +#define MY_PI 3.1415926
    +
    +void foo() {
    +    const double Pi = 3.141592653589;           // const double Pi = std::numbers::pi
    +    const auto Use = Pi / 2;                    // no match for Pi
    +    static constexpr double Euler = 2.7182818;  // static constexpr double Euler = std::numbers::e;
    +
    +    log2(exp(1));                               // std::numbers::log2e;
    +    log2(Euler);                                // std::numbers::log2e;
    +    1 / sqrt(MY_PI);                            // std::numbers::inv_sqrtpi;
    +    sink(MY_PI);                                // sink(std::numbers::pi);
    +    floatSink(MY_PI);                           // floatSink(std::numbers::pi);
    +    floatSink(static_cast<float>(MY_PI));       // floatSink(std::numbers::pi_v<float>);
    +}
    +

    Options

    +
    +

    DiffThreshold

    +

    A floating point value that sets the detection threshold for when literals match a constant. A literal matches a constant if abs(literal - constant) < DiffThreshold evaluates to true. Default is 0.001.

    +
    +
    +

    IncludeStyle

    +

    A string specifying which include-style is used, llvm or google. Default is llvm.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + modernize-use-std-print + modernize-use-std-print + + +

    clang-tidy - modernize-use-std-print

    + +

    modernize-use-std-print

    +

    Converts calls to printf, fprintf, absl::PrintF and absl::FPrintf to equivalent calls to C++23's std::print or std::println as appropriate, modifying the format string appropriately. The replaced and replacement functions can be customised by configuration options. Each argument that is the result of a call to std::string::c_str() and std::string::data() will have that now-unnecessary call removed in a similar manner to the readability-redundant-string-cstr check.

    +

    In other words, it turns lines like:

    +
    fprintf(stderr, "The %s is %3d\n", description.c_str(), value);
    +

    into:

    +
    std::println(stderr, "The {} is {:3}", description, value);
    +

    If the ReplacementPrintFunction or ReplacementPrintlnFunction options are left, or assigned to their default values then this check is only enabled with -std=c++23 or later.

    +

    The check doesn't do a bad job, but it's not perfect. In particular:

    +
      +
    • It assumes that the format string is correct for the arguments. If you get any warnings when compiling with -Wformat then misbehaviour is possible.
    • +
    • At the point that the check runs, the AST contains a single StringLiteral for the format string and any macro expansion, token pasting, adjacent string literal concatenation and escaping has been handled. Although it's possible for the check to automatically put the escapes back, they may not be exactly as they were written (e.g. "\x0a" will become "\n" and "ab" "cd" will become "abcd".) This is helpful since it means that the PRIx macros from <inttypes.h> are removed correctly.
    • +
    • It supports field widths, precision, positional arguments, leading zeros, leading +, alignment and alternative forms.
    • +
    • Use of any unsupported flags or specifiers will cause the entire statement to be left alone and a warning to be emitted. Particular unsupported features are: +
        +
      • The %' flag for thousands separators.
      • +
      • The glibc extension %m.
      • +
    • +
    • printf and similar functions return the number of characters printed. std::print does not. This means that any invocations that use the return value will not be converted. Unfortunately this currently includes explicitly-casting to void. Deficiencies in this check mean that any invocations inside GCC compound statements cannot be converted even if the resulting value is not used.
    • +
    +

    If conversion would be incomplete or unsafe then the entire invocation will be left unchanged.

    +

    If the call is deemed suitable for conversion then:

    +
      +
    • printf, fprintf, absl::PrintF, absl::FPrintF and any functions specified by the PrintfLikeFunctions option or FprintfLikeFunctions are replaced with the function specified by the ReplacementPrintlnFunction option if the format string ends with \n or ReplacementPrintFunction otherwise.
    • +
    • the format string is rewritten to use the std::formatter language. If a \n is found at the end of the format string not preceded by r then it is removed and ReplacementPrintlnFunction is used rather than ReplacementPrintFunction.
    • +
    • any arguments that corresponded to %p specifiers that std::formatter wouldn't accept are wrapped in a static_cast to const void *.
    • +
    • any arguments that corresponded to %s specifiers where the argument is of signed char or unsigned char type are wrapped in a reinterpret_cast<const char *>.
    • +
    • any arguments where the format string and the parameter differ in signedness will be wrapped in an appropriate static_cast if StrictMode is enabled.
    • +
    • any arguments that end in a call to std::string::c_str() or std::string::data() will have that call removed.
    • +
    +

    Options

    +
    +

    StrictMode

    +

    When true, the check will add casts when converting from variadic functions like printf and printing signed or unsigned integer types (including fixed-width integer types from <cstdint>, ptrdiff_t, size_t and ssize_t) as the opposite signedness to ensure that the output matches that of printf. This does not apply when converting from non-variadic functions such as absl::PrintF and fmt::printf. For example, with StrictMode enabled:

    +
    int i = -42;
    +unsigned int u = 0xffffffff;
    +printf("%d %u\n", i, u);
    +

    would be converted to:

    +
    std::print("{} {}\n", static_cast<unsigned int>(i), static_cast<int>(u));
    +

    to ensure that the output will continue to be the unsigned representation of -42 and the signed representation of 0xffffffff (often 4294967254 and -1 respectively.) When false (which is the default), these casts will not be added which may cause a change in the output.

    +
    +
    +

    PrintfLikeFunctions

    +

    A semicolon-separated list of (fully qualified) extra function names to replace, with the requirement that the first parameter contains the printf-style format string and the arguments to be formatted follow immediately afterwards. If neither this option nor FprintfLikeFunctions are set then the default value for this option is printf; absl::PrintF, otherwise it is empty.

    +
    +
    +

    FprintfLikeFunctions

    +

    A semicolon-separated list of (fully qualified) extra function names to replace, with the requirement that the first parameter is retained, the second parameter contains the printf-style format string and the arguments to be formatted follow immediately afterwards. If neither this option nor PrintfLikeFunctions are set then the default value for this option is fprintf; absl::FPrintF, otherwise it is empty.

    +
    +
    +

    ReplacementPrintFunction

    +

    The function that will be used to replace printf, fprintf etc. during conversion rather than the default std::print when the originalformat string does not end with \n. It is expected that the function provides an interface that is compatible with std::print. A suitable candidate would be fmt::print.

    +
    +
    +

    ReplacementPrintlnFunction

    +

    The function that will be used to replace printf, fprintf etc. during conversion rather than the default std::println when the original format string ends with \n. It is expected that the function provides an interface that is compatible with std::println. A suitable candidate would be fmt::println.

    +
    +
    +

    PrintHeader

    +

    The header that must be included for the declaration of ReplacementPrintFunction so that a #include directive can be added if required. If ReplacementPrintFunction is std::print then this option will default to <print>, otherwise this option will default to nothing and no #include directive will be added.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    modernize-use-trailing-return-type modernize-use-trailing-return-type @@ -10416,12 +13044,20 @@ using MyPtrType = void (Class::*)() const; using R_t = struct { int a; }; using R_p = R_t*; +

    The checker ignores typedef within extern "C" { ... } blocks.

    +
    extern "C" {
    +  typedef int InExternC; // Left intact.
    +}

    This check requires using C++11 or higher to run.

    Options

    IgnoreMacros

    If set to true, the check will not give warnings inside macros. Default is true.

    +
    +

    IgnoreExternC

    +

    If set to true, the check will not give warning inside extern "C"`scope. Default is `false

    +

    References

    clang.llvm.org

    ]]> @@ -10484,7 +13120,7 @@ MPI_Send(&buf, 1, MPI_CHAR, 0, 0, MPI_COMM_WORLD);

    objc-assert-equals

    Finds improper usages of XCTAssertEqual and XCTAssertNotEqual and replaces them with XCTAssertEqualObjects or XCTAssertNotEqualObjects.

    -

    This makes tests less fragile, as many improperly rely on pointer equality for strings that have equal values. This assumption is not guarantted by the language.

    +

    This makes tests less fragile, as many improperly rely on pointer equality for strings that have equal values. This assumption is not guaranteed by the language.

    References

    clang.llvm.org

    ]]> @@ -10567,76 +13203,150 @@ MPI_Send(&buf, 1, MPI_CHAR, 0, 0, MPI_COMM_WORLD); INFO
    - objc-nsinvocation-argument-lifetime - objc-nsinvocation-argument-lifetime - - -

    clang-tidy - objc-nsinvocation-argument-lifetime

    - -

    objc-nsinvocation-argument-lifetime

    -

    Finds calls to NSInvocation methods under ARC that don't have proper argument object lifetimes. When passing Objective-C objects as parameters to the NSInvocation methods getArgument:atIndex: and getReturnValue:, the values are copied by value into the argument pointer, which leads to incorrect releasing behavior if the object pointers are not declared __unsafe_unretained.

    -

    For code:

    -
    id arg;
    -[invocation getArgument:&arg atIndex:2];
    -
    -__strong id returnValue;
    -[invocation getReturnValue:&returnValue];
    -

    The fix will be:

    -
    __unsafe_unretained id arg;
    -[invocation getArgument:&arg atIndex:2];
    -
    -__unsafe_unretained id returnValue;
    -[invocation getReturnValue:&returnValue];
    -

    The check will warn on being passed instance variable references that have lifetimes other than __unsafe_unretained, but does not propose a fix:

    -
    // "id _returnValue" is declaration of instance variable of class.
    -[invocation getReturnValue:&self->_returnValue];
    -

    References

    -

    clang.llvm.org

    ]]> -
    - INFO -
    - - objc-property-declaration - objc-property-declaration - - -

    clang-tidy - objc-property-declaration

    - -

    objc-property-declaration

    -

    Finds property declarations in Objective-C files that do not follow the pattern of property names in Apple's programming guide. The property name should be in the format of Lower Camel Case.

    -

    For code:

    -
    @property(nonatomic, assign) int LowerCamelCase;
    -

    The fix will be:

    -
    @property(nonatomic, assign) int lowerCamelCase;
    -

    The check will only fix 'CamelCase' to 'camelCase'. In some other cases we will only provide warning messages since the property name could be complicated. Users will need to come up with a proper name by their own.

    -

    This check also accepts special acronyms as prefixes or suffixes. Such prefixes or suffixes will suppress the Lower Camel Case check according to the guide: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingBasics.html#//apple_ref/doc/uid/20001281-1002931-BBCFHEAB

    -

    For a full list of well-known acronyms: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/APIAbbreviations.html#//apple_ref/doc/uid/20001285-BCIHCGAE

    -

    The corresponding style rule: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingIvarsAndTypes.html#//apple_ref/doc/uid/20001284-1001757

    -

    The check will also accept property declared in category with a prefix of lowercase letters followed by a '_' to avoid naming conflict. For example:

    -
    @property(nonatomic, assign) int abc_lowerCamelCase;
    -

    The corresponding style rule: https://developer.apple.com/library/content/qa/qa1908/_index.html

    -

    References

    -

    clang.llvm.org

    ]]> -
    - INFO -
    - - objc-super-self - objc-super-self + objc-nsdate-formatter + objc-nsdate-formatter -

    clang-tidy - objc-super-self

    +

    clang-tidy - objc-nsdate-formatter

    -

    objc-super-self

    -

    Finds invocations of -self on super instances in initializers of subclasses of NSObject and recommends calling a superclass initializer instead.

    -

    Invoking -self on super instances in initializers is a common programmer error when the programmer's original intent is to call a superclass initializer. Failing to call a superclass initializer breaks initializer chaining and can result in invalid object initialization.

    -

    References

    -

    clang.llvm.org

    ]]> -
    - INFO -
    - - openmp-exception-escape +

    objc-nsdate-formatter

    +

    When NSDateFormatter is used to convert an NSDate type to a String type, the user can specify a custom format string. Certain format specifiers are undesirable despite being legal. See http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns for all legal date patterns.

    +

    This checker reports as warnings the following string patterns in a date format specifier:

    +
      +
    1. yyyy + ww : Calendar year specified with week of a week year (unless YYYY is also specified). +
        +
      • Example 1: Input Date: 29 December 2014 ; Format String: yyyy-ww;
        +Output string: 2014-01 (Wrong because it's not the first week of 2014)
      • +
      • Example 2: Input Date: 29 December 2014 ; Format String: dd-MM-yyyy (ww-YYYY);
        +Output string: 29-12-2014 (01-2015) (This is correct)
      • +
    2. +
    3. F without ee/EE : Numeric day of week in a month without actual day. +
        +
      • Example: Input Date: 29 December 2014 ; Format String: F-MM;
        +Output string: 5-12 (Wrong because it reads as 5th ___ of Dec in English)
      • +
    4. +
    5. F without MM : Numeric day of week in a month without month. +
        +
      • Example: Input Date: 29 December 2014 ; Format String: F-EE
        +Output string: 5-Mon (Wrong because it reads as 5th Mon of ___ in English)
      • +
    6. +
    7. WW without MM : Week of the month without the month. +
        +
      • Example: Input Date: 29 December 2014 ; Format String: WW-yyyy
        +Output string: 05-2014 (Wrong because it reads as 5th Week of ___ in English)
      • +
    8. +
    9. YYYY + QQ : Week year specified with quarter of normal year (unless yyyy is also specified). +
        +
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-QQ
        +Output string: 2015-04 (Wrong because it's not the 4th quarter of 2015)
      • +
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (QQ-yyyy)
        +Output string: 01-2015 (04-2014) (This is correct)
      • +
    10. +
    11. YYYY + MM : Week year specified with Month of a calendar year (unless yyyy is also specified). +
        +
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-MM
        +Output string: 2015-12 (Wrong because it's not the 12th month of 2015)
      • +
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (MM-yyyy)
        +Output string: 01-2015 (12-2014) (This is correct)
      • +
    12. +
    13. YYYY + DD : Week year with day of a calendar year (unless yyyy is also specified). +
        +
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-DD
        +Output string: 2015-363 (Wrong because it's not the 363rd day of 2015)
      • +
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (DD-yyyy)
        +Output string: 01-2015 (363-2014) (This is correct)
      • +
    14. +
    15. YYYY + WW : Week year with week of a calendar year (unless yyyy is also specified). +
        +
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-WW
        +Output string: 2015-05 (Wrong because it's not the 5th week of 2015)
      • +
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (WW-MM-yyyy)
        +Output string: 01-2015 (05-12-2014) (This is correct)
      • +
    16. +
    17. YYYY + F : Week year with day of week in a calendar month (unless yyyy is also specified). +
        +
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-ww-F-EE
        +Output string: 2015-01-5-Mon (Wrong because it's not the 5th Monday of January in 2015)
      • +
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (F-EE-MM-yyyy)
        +Output string: 01-2015 (5-Mon-12-2014) (This is correct)
      • +
    18. +
    +

    References

    +

    clang.llvm.org

    ]]> + + INFO +
    + + objc-nsinvocation-argument-lifetime + objc-nsinvocation-argument-lifetime + + +

    clang-tidy - objc-nsinvocation-argument-lifetime

    + +

    objc-nsinvocation-argument-lifetime

    +

    Finds calls to NSInvocation methods under ARC that don't have proper argument object lifetimes. When passing Objective-C objects as parameters to the NSInvocation methods getArgument:atIndex: and getReturnValue:, the values are copied by value into the argument pointer, which leads to incorrect releasing behavior if the object pointers are not declared __unsafe_unretained.

    +

    For code:

    +
    id arg;
    +[invocation getArgument:&arg atIndex:2];
    +
    +__strong id returnValue;
    +[invocation getReturnValue:&returnValue];
    +

    The fix will be:

    +
    __unsafe_unretained id arg;
    +[invocation getArgument:&arg atIndex:2];
    +
    +__unsafe_unretained id returnValue;
    +[invocation getReturnValue:&returnValue];
    +

    The check will warn on being passed instance variable references that have lifetimes other than __unsafe_unretained, but does not propose a fix:

    +
    // "id _returnValue" is declaration of instance variable of class.
    +[invocation getReturnValue:&self->_returnValue];
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + objc-property-declaration + objc-property-declaration + + +

    clang-tidy - objc-property-declaration

    + +

    objc-property-declaration

    +

    Finds property declarations in Objective-C files that do not follow the pattern of property names in Apple's programming guide. The property name should be in the format of Lower Camel Case.

    +

    For code:

    +
    @property(nonatomic, assign) int LowerCamelCase;
    +

    The fix will be:

    +
    @property(nonatomic, assign) int lowerCamelCase;
    +

    The check will only fix 'CamelCase' to 'camelCase'. In some other cases we will only provide warning messages since the property name could be complicated. Users will need to come up with a proper name by their own.

    +

    This check also accepts special acronyms as prefixes or suffixes. Such prefixes or suffixes will suppress the Lower Camel Case check according to the guide: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingBasics.html#//apple_ref/doc/uid/20001281-1002931-BBCFHEAB

    +

    For a full list of well-known acronyms: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/APIAbbreviations.html#//apple_ref/doc/uid/20001285-BCIHCGAE

    +

    The corresponding style rule: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingIvarsAndTypes.html#//apple_ref/doc/uid/20001284-1001757

    +

    The check will also accept property declared in category with a prefix of lowercase letters followed by a '_' to avoid naming conflict. For example:

    +
    @property(nonatomic, assign) int abc_lowerCamelCase;
    +

    The corresponding style rule: https://developer.apple.com/library/content/qa/qa1908/_index.html

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + objc-super-self + objc-super-self + + +

    clang-tidy - objc-super-self

    + +

    objc-super-self

    +

    Finds invocations of -self on super instances in initializers of subclasses of NSObject and recommends calling a superclass initializer instead.

    +

    Invoking -self on super instances in initializers is a common programmer error when the programmer's original intent is to call a superclass initializer. Failing to call a superclass initializer breaks initializer chaining and can result in invalid object initialization.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + openmp-exception-escape openmp-exception-escape @@ -10715,6 +13425,84 @@ void p0_3() { INFO + + performance-avoid-endl + performance-avoid-endl + + +

    clang-tidy - performance-avoid-endl

    + +

    performance-avoid-endl

    +

    Checks for uses of std::endl on streams and suggests using the newline character '\n' instead.

    +

    Rationale: Using std::endl on streams can be less efficient than using the newline character '\n' because std::endl performs two operations: it writes a newline character to the output stream and then flushes the stream buffer. Writing a single newline character using '\n' does not trigger a flush, which can improve performance. In addition, flushing the stream buffer can cause additional overhead when working with streams that are buffered.

    +

    Example:

    +

    Consider the following code:

    +
    #include <iostream>
    +
    +int main() {
    +  std::cout << "Hello" << std::endl;
    +}
    +

    Which gets transformed into:

    +
    #include <iostream>
    +
    +int main() {
    +  std::cout << "Hello" << '\n';
    +}
    +

    This code writes a single newline character to the std::cout stream without flushing the stream buffer.

    +

    Additionally, it is important to note that the standard C++ streams (like std::cerr, std::wcerr, std::clog and std::wclog) always flush after a write operation, unless std::ios_base::sync_with_stdio is set to false. regardless of whether std::endl or '\n' is used. Therefore, using '\n' with these streams will not result in any performance gain, but it is still recommended to use '\n' for consistency and readability.

    +

    If you do need to flush the stream buffer, you can use std::flush explicitly like this:

    +
    #include <iostream>
    +
    +int main() {
    +  std::cout << "Hello\n" << std::flush;
    +}
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + performance-enum-size + performance-enum-size + + +

    clang-tidy - performance-enum-size

    + +

    performance-enum-size

    +

    Recommends the smallest possible underlying type for an enum or enum class based on the range of its enumerators. Analyzes the values of the enumerators in an enum or enum class, including signed values, to recommend the smallest possible underlying type that can represent all the values of the enum. The suggested underlying types are the integral types std::uint8_t, std::uint16_t, and std::uint32_t for unsigned types, and std::int8_t, std::int16_t, and std::int32_t for signed types. Using the suggested underlying types can help reduce the memory footprint of the program and improve performance in some cases.

    +

    For example:

    +
    // BEFORE
    +enum Color {
    +    RED = -1,
    +    GREEN = 0,
    +    BLUE = 1
    +};
    +
    +std::optional<Color> color_opt;
    +

    The Color enum uses the default underlying type, which is int in this case, and its enumerators have values of -1, 0, and 1. Additionally, the std::optional<Color> object uses 8 bytes due to padding (platform dependent).

    +
    // AFTER
    +enum Color : std:int8_t {
    +    RED = -1,
    +    GREEN = 0,
    +    BLUE = 1
    +}
    +
    +std::optional<Color> color_opt;
    +

    In the revised version of the Color enum, the underlying type has been changed to std::int8_t. The enumerator RED has a value of -1, which can be represented by a signed 8-bit integer.

    +

    By using a smaller underlying type, the memory footprint of the Color enum is reduced from 4 bytes to 1 byte. The revised version of the std::optional<Color> object would only require 2 bytes (due to lack of padding), since it contains a single byte for the Color enum and a single byte for the bool flag that indicates whether the optional value is set.

    +

    Reducing the memory footprint of an enum can have significant benefits in terms of memory usage and cache performance. However, it's important to consider the trade-offs and potential impact on code readability and maintainability.

    +

    Enums without enumerators (empty) are excluded from analysis.

    +

    Requires C++11 or above. Does not provide auto-fixes.

    +

    Options

    +
    +

    EnumIgnoreList

    +

    Option is used to ignore certain enum types. It accepts a semicolon-separated list of (fully qualified) enum type names or regular expressions that match the enum type names. The default value is an empty string, which means no enums will be ignored.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    performance-faster-string-find performance-faster-string-find @@ -10773,8 +13561,7 @@ str.find('A'); performance-implicit-cast-in-loop performance-implicit-cast-in-loop - +
    orphan
    @@ -10786,7 +13573,8 @@ str.find('A');

    performance-implicit-cast-in-loop

    -

    This check has been renamed to performance-implicit-conversion-in-loop.

    +

    This check has been renamed to performance-implicit-conversion-in-loop +<../performance/implicit-conversion-in-loop>.

    References

    clang.llvm.org

    ]]>
    @@ -11011,7 +13799,7 @@ StatusOr<std::vector<int>> NotCool() { const std::vector<int> obj = ...; return obj; // calls `StatusOr::StatusOr(const std::vector<int>&)` } -

    The former version (Cool) should be preferred over the latter (Uncool) as it will avoid allocations and potentially large memory copies.

    +

    The former version (Cool) should be preferred over the latter (NotCool) as it will avoid allocations and potentially large memory copies.

    Semantics

    In the example above, StatusOr::StatusOr(T&&) have the same semantics as long as the copy and move constructors for T have the same semantics. Note that there is no guarantee that S::S(T&&) and S::S(const T&) have the same semantics for any single S, so we're not providing automated fixes for this check, and judgement should be exerted when making the suggested changes.

    -Wreturn-std-move

    @@ -11059,6 +13847,21 @@ tgt(char* maybe_underbiased_ptr) { MINOR
    + + performance-noexcept-destructor + performance-noexcept-destructor + + +

    clang-tidy - performance-noexcept-destructor

    + +

    performance-noexcept-destructor

    +

    The check flags user-defined destructors marked with noexcept(expr) where expr evaluates to false (but is not a false literal itself).

    +

    When a destructor is marked as noexcept, it assures the compiler that no exceptions will be thrown during the destruction of an object, which allows the compiler to perform certain optimizations such as omitting exception handling code.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    performance-noexcept-move-constructor performance-noexcept-move-constructor @@ -11074,6 +13877,21 @@ tgt(char* maybe_underbiased_ptr) { MINOR + + performance-noexcept-swap + performance-noexcept-swap + + +

    clang-tidy - performance-noexcept-swap

    + +

    performance-noexcept-swap

    +

    The check flags user-defined swap and iter_swap functions not marked with noexcept or marked with noexcept(expr) where expr evaluates to false (but is not a false literal itself).

    +

    When a swap or iter_swap function is marked as noexcept, it assures the compiler that no exceptions will be thrown during the swapping of two objects, which allows the compiler to perform certain optimizations such as omitting exception handling code.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    performance-trivially-destructible performance-trivially-destructible @@ -11276,6 +14094,31 @@ vec_add(a, b); // Power INFO + + portability-std-allocator-const + portability-std-allocator-const + + +

    clang-tidy - portability-std-allocator-const

    + +

    portability-std-allocator-const

    +

    Report use of std::vector<const T> (and similar containers of const elements). These are not allowed in standard C++, and should usually be std::vector<T> instead."

    +

    Per C++ [allocator.requirements.general]: "T is any cv-unqualified object type", std::allocator<const T> is undefined. Many standard containers use std::allocator by default and therefore their const T instantiations are undefined.

    +

    libc++ defines std::allocator<const T> as an extension which will be removed in the future.

    +

    libstdc++ and MSVC do not support std::allocator<const T>:

    +
    // libstdc++ has a better diagnostic since https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48101
    +std::deque<const int> deque; // error: static assertion failed: std::deque must have a non-const, non-volatile value_type
    +std::set<const int> set; // error: static assertion failed: std::set must have a non-const, non-volatile value_type
    +std::vector<int* const> vector; // error: static assertion failed: std::vector must have a non-const, non-volatile value_type
    +
    +// MSVC
    +// error C2338: static_assert failed: 'The C++ Standard forbids containers of const elements because allocator<const T> is ill-formed.'
    +

    Code bases only compiled with libc++ may accrue such undefined usage. This check finds such code and prevents backsliding while clean-up is ongoing.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    readability-avoid-const-params-in-decls readability-avoid-const-params-in-decls @@ -11299,6 +14142,84 @@ void f(const string&); // Good: const is not top level. MINOR + + readability-avoid-nested-conditional-operator + readability-avoid-nested-conditional-operator + + +

    clang-tidy - readability-avoid-nested-conditional-operator

    + +

    readability-avoid-nested-conditional-operator

    +

    Identifies instances of nested conditional operators in the code.

    +

    Nested conditional operators, also known as ternary operators, can contribute to reduced code readability and comprehension. So they should be split as several statements and stored the intermediate results in temporary variable.

    +

    Examples:

    +
    int NestInConditional = (condition1 ? true1 : false1) ? true2 : false2;
    +int NestInTrue = condition1 ? (condition2 ? true1 : false1) : false2;
    +int NestInFalse = condition1 ? true1 : condition2 ? true2 : false1;
    +

    This check implements part of AUTOSAR C++14 Rule A5-16-1.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + readability-avoid-return-with-void-value + readability-avoid-return-with-void-value + + +

    clang-tidy - readability-avoid-return-with-void-value

    + +

    readability-avoid-return-with-void-value

    +

    Finds return statements with void values used within functions with void result types.

    +

    A function with a void return type is intended to perform a task without producing a return value. Return statements with expressions could lead to confusion and may miscommunicate the function's intended behavior.

    +

    Example:

    +
    void g();
    +void f() {
    +    // ...
    +    return g();
    +}
    +

    In a long function body, the return statement suggests that the function returns a value. However, return g(); is a combination of two statements that should be written as

    +
    g();
    +return;
    +

    to make clear that g() is called and immediately afterwards the function returns (nothing).

    +

    In C, the same issue is detected by the compiler if the -Wpedantic mode is enabled.

    +

    Options

    +
    +

    IgnoreMacros

    +

    The value false specifies that return statements expanded from macros are not checked. The default value is true.

    +
    +
    +

    StrictMode

    +

    The value false specifies that a direct return statement shall be excluded from the analysis if it is the only statement not contained in a block like if (cond) return g();. The default value is true.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    + + readability-avoid-unconditional-preprocessor-if + readability-avoid-unconditional-preprocessor-if + + +

    clang-tidy - readability-avoid-unconditional-preprocessor-if

    + +

    readability-avoid-unconditional-preprocessor-if

    +

    Finds code blocks that are constantly enabled or disabled in preprocessor directives by analyzing #if conditions, such as #if 0 and #if 1, etc.

    +
    #if 0
    +    // some disabled code
    +#endif
    +
    +#if 1
    +   // some enabled code that can be disabled manually
    +#endif
    +

    Unconditional preprocessor directives, such as #if 0 for disabled code and #if 1 for enabled code, can lead to dead code and always enabled code, respectively. Dead code can make understanding the codebase more difficult, hinder readability, and may be a sign of unfinished functionality or abandoned features. This can cause maintenance issues, confusion for future developers, and potential compilation problems.

    +

    As a solution for both cases, consider using preprocessor macros or defines, like #ifdef DEBUGGING_ENABLED, to control code enabling or disabling. This approach provides better coordination and flexibility when working with different parts of the codebase. Alternatively, you can comment out the entire code using /* */ block comments and add a hint, such as @todo, to indicate future actions.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    readability-braces-around-statements readability-braces-around-statements @@ -11419,6 +14340,11 @@ const Clazz* foo();

    readability-container-data-pointer

    Finds cases where code could use data() rather than the address of the element at index 0 in a container. This pattern is commonly used to materialize a pointer to the backing data of a container. std::vector and std::string provide a data() accessor to retrieve the data pointer which should be preferred.

    This also ensures that in the case that the container is empty, the data pointer access does not perform an errant memory access.

    +

    Options

    +
    +

    IgnoredContainers

    +

    Semicolon-separated list of containers regexp for which this check won't be enforced. Default is empty.

    +

    References

    clang.llvm.org

    ]]> @@ -11432,12 +14358,17 @@ const Clazz* foo();

    clang-tidy - readability-container-size-empty

    readability-container-size-empty

    -

    Checks whether a call to the size() method can be replaced with a call to empty().

    -

    The emptiness of a container should be checked using the empty() method instead of the size() method. It is not guaranteed that size() is a constant-time function, and it is generally more efficient and also shows clearer intent to use empty(). Furthermore some containers may implement the empty() method but not implement the size() method. Using empty() whenever possible makes it easier to switch to another container in the future.

    -

    The check issues warning if a container has size() and empty() methods matching following signatures:

    +

    Checks whether a call to the size()/length() method can be replaced with a call to empty().

    +

    The emptiness of a container should be checked using the empty() method instead of the size()/length() method. It is not guaranteed that size()/length() is a constant-time function, and it is generally more efficient and also shows clearer intent to use empty(). Furthermore some containers may implement the empty() method but not implement the size() or length() method. Using empty() whenever possible makes it easier to switch to another container in the future.

    +

    The check issues warning if a container has empty() and size() or length() methods matching following signatures:

    size_type size() const;
    +size_type length() const;
     bool empty() const;

    size_type can be any kind of integer type.

    +
    +

    ExcludedComparisonTypes

    +

    A semicolon-separated list of class names for which the check will ignore comparisons of objects with default-constructed objects of the same type. If a class is listed here, the check will not suggest using empty() instead of such comparisons for objects of that class. Default value is: ::std::array.

    +

    References

    clang.llvm.org

    ]]> @@ -11453,7 +14384,7 @@ bool empty() const;

    readability-convert-member-functions-to-static

    Finds non-static member functions that can be made static because the functions don't use this.

    After applying modifications as suggested by the check, running the check again might find more opportunities to mark member functions static.

    -

    After making a member function static, you might want to run the check readability-static-accessed-through-instance to replace calls like Instance.method() by Class::method().

    +

    After making a member function static, you might want to run the check readability-static-accessed-through-instance <../readability/static-accessed-through-instance> to replace calls like Instance.method() by Class::method().

    References

    clang.llvm.org

    ]]> @@ -11731,7 +14662,7 @@ if (p)

    Options

    LineThreshold

    -

    Flag functions exceeding this number of lines. The default is -1 (ignore the number of lines).

    +

    Flag functions exceeding this number of lines. The default is none (ignore the number of lines).

    StatementThreshold

    @@ -11739,19 +14670,19 @@ if (p)

    BranchThreshold

    -

    Flag functions exceeding this number of control statements. The default is -1 (ignore the number of branches).

    +

    Flag functions exceeding this number of control statements. The default is none (ignore the number of branches).

    ParameterThreshold

    -

    Flag functions that exceed a specified number of parameters. The default is -1 (ignore the number of parameters).

    +

    Flag functions that exceed a specified number of parameters. The default is none (ignore the number of parameters).

    NestingThreshold

    -

    Flag compound statements which create next nesting level after NestingThreshold. This may differ significantly from the expected value for macro-heavy code. The default is -1 (ignore the nesting level).

    +

    Flag compound statements which create next nesting level after NestingThreshold. This may differ significantly from the expected value for macro-heavy code. The default is none (ignore the nesting level).

    VariableThreshold

    -

    Flag functions exceeding this number of variables declared in the body. The default is -1 (ignore the number of variables). Please note that function parameters and variables declared in lambdas, GNU Statement Expressions, and nested class inline functions are not counted.

    +

    Flag functions exceeding this number of variables declared in the body. The default is none (ignore the number of variables). Please note that function parameters and variables declared in lambdas, GNU Statement Expressions, and nested class inline functions are not counted.

    References

    clang.llvm.org

    ]]> @@ -11863,22 +14794,26 @@ catch (const std::exception& e) {
  • CamelCase,
  • camel_Snake_Back,
  • Camel_Snake_Case,
  • -
  • aNy_CasE.
  • +
  • aNy_CasE,
  • +
  • Leading_upper_snake_case.
  • It also supports a fixed prefix and suffix that will be prepended or appended to the identifiers, regardless of the casing.

    Many configuration options are available, in order to be able to create different rules for different kinds of identifiers. In general, the rules are falling back to a more generic rule if the specific case is not configured.

    The naming of virtual methods is reported where they occur in the base class, but not where they are overridden, as it can't be fixed locally there. This also applies for pseudo-override patterns like CRTP.

    +

    Leading_upper_snake_case is a naming convention where the first word is capitalized followed by lower case word(s) seperated by underscore(s) '_'. Examples include: Cap_snake_case, Cobra_case, Foo_bar_baz, and Master_copy_8gb.

    Options

    The following options are described below:

    • AbstractClassCase, AbstractClassPrefix, AbstractClassSuffix, AbstractClassIgnoredRegexp, AbstractClassHungarianPrefix
    • AggressiveDependentMemberLookup
    • +
    • CheckAnonFieldInParent
    • ClassCase, ClassPrefix, ClassSuffix, ClassIgnoredRegexp, ClassHungarianPrefix
    • ClassConstantCase, ClassConstantPrefix, ClassConstantSuffix, ClassConstantIgnoredRegexp, ClassConstantHungarianPrefix
    • ClassMemberCase, ClassMemberPrefix, ClassMemberSuffix, ClassMemberIgnoredRegexp, ClassMemberHungarianPrefix
    • ClassMethodCase, ClassMethodPrefix, ClassMethodSuffix, ClassMethodIgnoredRegexp
    • +
    • ConceptCase, ConceptPrefix, ConceptSuffix, ConceptIgnoredRegexp
    • ConstantCase, ConstantPrefix, ConstantSuffix, ConstantIgnoredRegexp, ConstantHungarianPrefix
    • ConstantMemberCase, ConstantMemberPrefix, ConstantMemberSuffix, ConstantMemberIgnoredRegexp, ConstantMemberHungarianPrefix
    • ConstantParameterCase, ConstantParameterPrefix, ConstantParameterSuffix, ConstantParameterIgnoredRegexp, ConstantParameterHungarianPrefix
    • @@ -12016,6 +14951,19 @@ struct Derived : Base<T> { } };
      +

      CheckAnonFieldInParent

      +

      When set to true, fields in anonymous records (i.e. anonymous unions and structs) will be treated as names in the enclosing scope rather than public members of the anonymous record for the purpose of name checking.

      +
      +

      For example:

      +
      class Foo {
      +private:
      +  union {
      +    int iv_;
      +    float fv_;
      +  };
      +};
      +

      If CheckAnonFieldInParent is false, you may get warnings that iv_ and fv_ are not coherent to public member names, because iv_ and fv_ are public members of the anonymous union. When CheckAnonFieldInParent is true, iv_ and fv_ will be treated as private data members of Foo for the purpose of name checking and thus no warnings will be emitted.

      +

      ClassCase

      When defined, the check will ensure class names conform to the selected casing.

      @@ -12173,6 +15121,35 @@ public: int pre_class_member_post(); };
      +

      ConceptCase

      +

      When defined, the check will ensure concept names conform to the selected casing.

      +
      +
      +

      ConceptPrefix

      +

      When defined, the check will ensure concept names will add the prefixed with the given value (regardless of casing).

      +
      +
      +

      ConceptIgnoredRegexp

      +

      Identifier naming checks won't be enforced for concept names matching this regular expression.

      +
      +
      +

      ConceptSuffix

      +

      When defined, the check will ensure concept names will add the suffix with the given value (regardless of casing).

      +
      +

      For example using values of:

      +
      +
        +
      • ConceptCase of CamelCase
      • +
      • ConceptPrefix of Pre
      • +
      • ConceptSuffix of Post
      • +
      +
      +

      Identifies and/or transforms concept names as follows:

      +

      Before:

      +
      template<typename T> concept my_concept = requires (T t) { {t++}; };
      +

      After:

      +
      template<typename T> concept PreMyConceptPost = requires (T t) { {t++}; };
      +

      ConstantCase

      When defined, the check will ensure constant names conform to the selected casing.

      @@ -13743,132 +16720,224 @@ public: - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + +
      Primitive TypesMicrosoft data typesPrimitive TypeMicrosoft Type
      -

      Type Prefix Type Prefix

      +

      Type

      Type Prefix
      ================= ============== ====================== ========================= ==============
      int8_t i8 signed int siBOOL b
      int16_t i16 signed short ssBOOLEAN b
      int32_t i32 signed short int ssiBYTE byPrefixTypePrefixTypePrefix
      int64_t i64 signed long long int slliCHAR c===============================================================================================
      uint8_t u8 signed long long sllUCHAR ucint8_ti8signed intsiBOOLb
      uint16_t u16 signed long int sliSHORT sint16_ti16signed shortssBOOLEANb
      uint32_t u32 signed long slUSHORT usint32_ti32signed short intssiBYTEby
      uint64_t u64 signed sWORD wint64_ti64signed long long intslliCHARc
      char8_t c8 unsigned long long int ulliDWORD dwuint8_tu8signed long longsllUCHARuc
      char16_t c16 unsigned long long ullDWORD32 dw32uint16_tu16signed long intsliSHORTs
      char32_t c32 unsigned long int uliDWORD64 dw64uint32_tu32signed longslUSHORTus
      float f unsigned long ulLONG luint64_tu64signedsWORDw
      double d unsigned short int usiULONG ulchar8_tc8unsigned long long intulliDWORDdw
      char c unsigned short usULONG32 ul32char16_tc16unsigned long longullDWORD32dw32
      bool b unsigned int uiULONG64 ul64char32_tc32unsigned long intuliDWORD64dw64
      _Bool b unsigned uULONGLONG ullfloatfunsigned longulLONGl
      int i long long int lliHANDLE hdoubledunsigned short intusiULONGul
      size_t n long double ldINT icharcunsigned shortusULONG32ul32
      short s long long llINT8 i8boolbunsigned intuiULONG64ul64
      signed i long int liINT16 i16_Boolbunsigned charucULONGLONGull
      unsigned u long lINT32 i32intiunsigneduHANDLEh
      long l ptrdiff_t pINT64 i64size_tnlong long intlliINTi
      long long llUINT uishortslong doubleldINT8i8
      unsigned long ulUINT8 u8signedilong longllINT16i16
      long double ldUINT16 u16unsignedulong intliINT32i32
      ptrdiff_t pUINT32 u32longllonglINT64i64
      wchar_t wcUINT64 u64long longllptrdiff_tpUINTui

      short int si short s

      PVOID p

      unsigned long long double ptrdiff_t wchar_t short int short

      ul ld p wc si s

      void

      none

      UINT8 UINT16 UINT32 UINT64 PVOID

      u8 u16 u32 u64 p

      @@ -13896,9 +16965,9 @@ public:
    • HungarianNotation.DerivedType.Array
    • HungarianNotation.DerivedType.Pointer
    • HungarianNotation.DerivedType.FunctionPointer
    • -
    • HungarianNotation.CString.CharPrinter
    • +
    • HungarianNotation.CString.CharPointer
    • HungarianNotation.CString.CharArray
    • -
    • HungarianNotation.CString.WideCharPrinter
    • +
    • HungarianNotation.CString.WideCharPointer
    • HungarianNotation.CString.WideCharArray
    • HungarianNotation.PrimitiveType.*
    • HungarianNotation.UserDefinedType.*
    • @@ -13936,7 +17005,7 @@ void *pDataBuffer = NULL; typedef void (*FUNC_PTR)(); FUNC_PTR fnFuncPtr = NULL;
      -

      HungarianNotation.CString.CharPrinter

      +

      HungarianNotation.CString.CharPointer

      When defined, the check will ensure variable name will add the prefix with the given string. The default prefix is sz.

      @@ -13944,7 +17013,7 @@ FUNC_PTR fnFuncPtr = NULL;

      When defined, the check will ensure variable name will add the prefix with the given string. The default prefix is sz.

      -

      HungarianNotation.CString.WideCharPrinter

      +

      HungarianNotation.CString.WideCharPointer

      When defined, the check will ensure variable name will add the prefix with the given string. The default prefix is wsz.

      @@ -13952,20 +17021,22 @@ FUNC_PTR fnFuncPtr = NULL;

      When defined, the check will ensure variable name will add the prefix with the given string. The default prefix is wsz.

      Before:

      -
      // CharPrinter
      +
      // CharPointer
       const char *NamePtr = "Name";
       // CharArray
       const char NameArray[] = "Name";
      -// WideCharPrinter
      +
      +// WideCharPointer
       const wchar_t *WideNamePtr = L"Name";
       // WideCharArray
       const wchar_t WideNameArray[] = L"Name";

      After:

      -
      // CharPrinter
      +
      // CharPointer
       const char *szNamePtr = "Name";
       // CharArray
       const char szNameArray[] = "Name";
      -// WideCharPrinter
      +
      +// WideCharPointer
       const wchar_t *wszWideNamePtr = L"Name";
       // WideCharArray
       const wchar_t wszWideNameArray[] = L"Name";
      @@ -14012,8 +17083,7 @@ DWORD dwValueDword = 0;
      readability-implicit-bool-cast readability-implicit-bool-cast - +
      orphan
      @@ -14025,7 +17095,8 @@ DWORD dwValueDword = 0;

      readability-implicit-bool-cast

      -

      This check has been renamed to readability-implicit-bool-conversion.

      +

      This check has been renamed to readability-implicit-bool-conversion +<../readability/implicit-bool-conversion>.

      References

      clang.llvm.org

      ]]> @@ -14263,7 +17334,7 @@ void macros() {

      Examples of magic values:

      -
      double circleArea = 3.1415926535 * radius * radius;
      +
      template<typename T, size_t N>
      +struct CustomType {
      +   T arr[N];
      +};
      +
      +struct OtherType {
      +   CustomType<int, 30> container;
      +}
      +CustomType<int, 30> values;
      +
      +double circleArea = 3.1415926535 * radius * radius;
       
       double totalCharge = 1.08 * itemPrice;
       
      @@ -14283,7 +17364,20 @@ for (int mm = 1; mm <= 12; ++mm) {
          std::cout << month[mm] << '\n';
       }

      Example with magic values refactored:

      -
      double circleArea = M_PI * radius * radius;
      +
      template<typename T, size_t N>
      +struct CustomType {
      +   T arr[N];
      +};
      +
      +const size_t NUMBER_OF_ELEMENTS = 30;
      +using containerType = CustomType<int, NUMBER_OF_ELEMENTS>;
      +
      +struct OtherType {
      +   containerType container;
      +}
      +containerType values;
      +
      +double circleArea = M_PI * radius * radius;
       
       const double TAX_RATE = 0.08;  // or make it variable and read from a file
       
      @@ -14323,6 +17417,14 @@ for (int mm = 1; mm <= MONTHS_IN_A_YEAR; ++mm) {
       

      IgnoreBitFieldsWidths

      Boolean value indicating whether to accept magic numbers as bit field widths without warning. This is useful for example for register definitions which are generated from hardware specifications. Default value is true.

      +
      +

      IgnoreTypeAliases

      +

      Boolean value indicating whether to accept magic numbers in typedef or using declarations. Default value is false.

      +
      +
      +

      IgnoreUserDefinedLiterals

      +

      Boolean value indicating whether to accept magic numbers in user-defined literals. Default value is false.

      +

      References

      clang.llvm.org

      ]]> @@ -14355,7 +17457,7 @@ for (int mm = 1; mm <= MONTHS_IN_A_YEAR; ++mm) {
    • contain a const_cast
    • are templated or part of a class template
    • have an empty body
    • -
    • do not (implicitly) use this at all (see readability-convert-member-functions-to-static).
    • +
    • do not (implicitly) use this at all (see readability-convert-member-functions-to-static <../readability/convert-member-functions-to-static>).

    The following real-world examples will be preserved by the check:

    class E1 {
    @@ -14454,7 +17556,13 @@ if (cond1)
     

    Find functions with unnamed arguments.

    The check implements the following rule originating in the Google C++ Style Guide:

    https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions

    -

    All parameters should be named, with identical names in the declaration and implementation.

    +

    All parameters should have the same name in both the function declaration and definition. If a parameter is not utilized, its name can be commented out in a function definition.

    +
    int doingSomething(int a, int b, int c);
    +
    +int doingSomething(int a, int b, int /*c*/) {
    +    // Ok: the third param is not used
    +    return a + b;
    +}

    Corresponding cpplint.py check name: readability/function.

    References

    clang.llvm.org

    ]]> @@ -14511,6 +17619,104 @@ void f4(int *p) { INFO + + readability-operators-representation + readability-operators-representation + + +

    clang-tidy - readability-operators-representation

    + +

    readability-operators-representation

    +

    Enforces consistent token representation for invoked binary, unary and overloaded operators in C++ code. The check supports both traditional and alternative representations of operators, such as && and and, || and or, and so on.

    +

    In the realm of C++ programming, developers have the option to choose between two distinct representations for operators: traditional token representation and alternative token representation. Traditional tokens utilize symbols, such as &&, ||, and !, while alternative tokens employ more descriptive words like and, or, and not.

    +

    In the following mapping table, a comprehensive list of traditional and alternative tokens, along with their corresponding representations, is presented:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Token Representation Mapping Table
    TraditionalAlternative
    &&and
    &=and_eq
    &bitand
    |bitor
    ~compl
    !not
    !=not_eq
    ||or
    |=or_eq
    ^xor
    ^=xor_eq
    +

    Example

    +
    // Traditional Token Representation:
    +
    +if (!a||!b)
    +{
    +    // do something
    +}
    +
    +// Alternative Token Representation:
    +
    +if (not a or not b)
    +{
    +    // do something
    +}
    +

    Options

    +

    Due to the distinct benefits and drawbacks of each representation, the default configuration doesn't enforce either. Explicit configuration is needed.

    +

    To configure check to enforce Traditional Token Representation for all operators set options to &&;&=;&;|;~;!;!=;||;|=;^;^=.

    +

    To configure check to enforce Alternative Token Representation for all operators set options to and;and_eq;bitand;bitor;compl;not;not_eq;or;or_eq;xor;xor_eq.

    +

    Developers do not need to enforce all operators, and can mix the representations as desired by specifying a semicolon-separated list of both traditional and alternative tokens in the configuration, such as and;||;not.

    +
    +

    BinaryOperators

    +

    This option allows you to specify a semicolon-separated list of binary operators for which you want to enforce specific token representation. The default value is empty string.

    +
    +
    +

    OverloadedOperators

    +

    This option allows you to specify a semicolon-separated list of overloaded operators for which you want to enforce specific token representation. The default value is empty string.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    readability-qualified-auto readability-qualified-auto @@ -14604,6 +17810,33 @@ public: INFO + + readability-redundant-casting + readability-redundant-casting + + +

    clang-tidy - readability-redundant-casting

    + +

    readability-redundant-casting

    +

    Detects explicit type casting operations that involve the same source and destination types, and subsequently recommend their removal. Covers a range of explicit casting operations, including static_cast, const_cast, C-style casts, and reinterpret_cast. Its primary objective is to enhance code readability and maintainability by eliminating unnecessary type casting.

    +
    int value = 42;
    +int result = static_cast<int>(value);
    +

    In this example, the static_cast<int>(value) is redundant, as it performs a cast from an int to another int.

    +

    Casting operations involving constructor conversions, user-defined conversions, functional casts, type-dependent casts, casts between distinct type aliases that refer to the same underlying type, as well as bitfield-related casts and casts directly from lvalue to rvalue, are all disregarded by the check.

    +

    Options

    +
    +

    IgnoreMacros

    +

    If set to true, the check will not give warnings inside macros. Default is true.

    +
    +
    +

    IgnoreTypeAliases

    +

    When set to false, the check will consider type aliases, and when set to true, it will resolve all type aliases and operate on the underlying types. Default is false.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    readability-redundant-control-flow readability-redundant-control-flow @@ -14695,6 +17928,32 @@ int i = (*p)(10, 50);
    INFO + + readability-redundant-inline-specifier + readability-redundant-inline-specifier + + +

    clang-tidy - readability-redundant-inline-specifier

    + +

    readability-redundant-inline-specifier

    +

    Detects redundant inline specifiers on function and variable declarations.

    +

    Examples:

    +
    constexpr inline void f() {}
    +

    In the example above the keyword inline is redundant since constexpr functions are implicitly inlined

    +
    class MyClass {
    +    inline void myMethod() {}
    +};
    +

    In the example above the keyword inline is redundant since member functions defined entirely inside a class/struct/union definition are implicitly inlined.

    +

    Options

    +
    +

    StrictMode

    +

    If set to true, the check will also flag functions and variables that already have internal linkage as redundant.

    +
    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    readability-redundant-member-init readability-redundant-member-init @@ -14705,13 +17964,14 @@ int i = (*p)(10, 50);

    readability-redundant-member-init

    Finds member initializations that are unnecessary because the same default constructor would be called if they were not present.

    Example

    -
    // Explicitly initializing the member s is unnecessary.
    +
    // Explicitly initializing the member s and v is unnecessary.
     class Foo {
     public:
       Foo() : s() {}
     
     private:
       std::string s;
    +  std::vector<int> v {};
     };

    Options

    @@ -14817,6 +18077,11 @@ if (ptr.get() == nullptr) ... => if (ptr == nullptr) ...

    readability-redundant-string-cstr

    Finds unnecessary calls to std::string::c_str() and std::string::data().

    +

    Options

    +
    +

    StringParameterFunctions

    +

    A semicolon-separated list of (fully qualified) function/method/operator names, with the requirement that any parameter currently accepting a const char* input should also be able to accept std::string inputs, or proper overload candidates that can do so should exist. This can be used to configure functions such as fmt::format, spdlog::logger::info, or wrappers around these and similar functions. The default value is the empty string.

    +

    References

    clang.llvm.org

    ]]> @@ -14860,6 +18125,28 @@ std::string_view b;
    INFO + + readability-reference-to-constructed-temporary + readability-reference-to-constructed-temporary + + +

    clang-tidy - readability-reference-to-constructed-temporary

    + +

    readability-reference-to-constructed-temporary

    +

    Detects C++ code where a reference variable is used to extend the lifetime of a temporary object that has just been constructed.

    +

    This construction is often the result of multiple code refactorings or a lack of developer knowledge, leading to confusion or subtle bugs. In most cases, what the developer really wanted to do is create a new variable rather than extending the lifetime of a temporary object.

    +

    Examples of problematic code include:

    +
    const std::string& str("hello");
    +
    +struct Point { int x; int y; };
    +const Point& p = { 1, 2 };
    +

    In the first example, a const std::string& reference variable str is assigned a temporary object created by the std::string("hello") constructor. In the second example, a const Point& reference variable p is assigned an object that is constructed from an initializer list { 1, 2 }. Both of these examples extend the lifetime of the temporary object to the lifetime of the reference variable, which can make it difficult to reason about and may lead to subtle bugs or misunderstanding.

    +

    To avoid these issues, it is recommended to change the reference variable to a (const) value variable.

    +

    References

    +

    clang.llvm.org

    ]]> +
    + INFO +
    readability-simplify-boolean-expr readability-simplify-boolean-expr @@ -15039,6 +18326,10 @@ std::string_view b;

    Options

    +

    IgnoreMacros

    +

    If true, ignore boolean expressions originating from expanded macros. Default is false.

    +
    +

    ChainedConditionalReturn

    If true, conditional boolean return statements at the end of an if/else if chain will be transformed. Default is false.

    @@ -15080,7 +18371,7 @@ char c = s.data()[i]; // char c = s[i];

    Options

    Types

    -

    The list of type(s) that triggers this check. Default is ::std::basic_string;::std::basic_string_view;::std::vector;::std::array

    +

    The list of type(s) that triggers this check. Default is ::std::basic_string;::std::basic_string_view;::std::vector;::std::array;::std::span

    References

    clang.llvm.org

    ]]> @@ -15101,15 +18392,21 @@ char c = s.data()[i]; // char c = s[i];
    struct C {
       static void foo();
       static int x;
    +  enum { E1 };
    +  enum E { E2 };
     };
     
     C *c1 = new C();
     c1->foo();
    -c1->x;
    +c1->x; +c1->E1; +c1->E2;

    is changed to:

    C *c1 = new C();
     C::foo();
    -C::x;
    +C::x; +C::E1; +C::E2;

    References

    clang.llvm.org

    ]]> @@ -15446,12048 +18743,12765 @@ Derived(); // and so temporary construction is okay BUG
    - - abseil-cleanup-ctad - abseil-cleanup-ctad - - -

    clang-tidy - abseil-cleanup-ctad

    - -

    abseil-cleanup-ctad

    -

    Suggests switching the initialization pattern of absl::Cleanup instances from the factory function to class template argument deduction (CTAD), in C++17 and higher.

    -
    auto c1 = absl::MakeCleanup([] {});
     
    -const auto c2 = absl::MakeCleanup(std::function<void()>([] {}));
    -

    becomes

    -
    absl::Cleanup c1 = [] {};
    +  
     
    -const absl::Cleanup c2 = std::function<void()>([] {});
    + + clang-diagnostic-aix-compat + clang-diagnostic-aix-compat + + Diagnostic text:

    +
      +
    • warning: #pragma align(packed) may not be compatible with objects generated with AIX XL C/C++
    • +
    • warning: alignment of 16 bytes for a struct member is not binary compatible with IBM XL C/C++ for AIX 16.1.0 or older
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - bugprone-assignment-in-if-condition - bugprone-assignment-in-if-condition + clang-diagnostic-arc-non-pod-memaccess + clang-diagnostic-arc-non-pod-memaccess - -

    clang-tidy - bugprone-assignment-in-if-condition

    - -

    bugprone-assignment-in-if-condition

    -

    Finds assignments within conditions of if statements. Such assignments are bug-prone because they may have been intended as equality tests.

    -

    This check finds all assignments within if conditions, including ones that are not flagged by -Wparentheses due to an extra set of parentheses, and including assignments that call an overloaded operator=(). The identified assignments violate BARR group "Rule 8.2.c".

    -
    int f = 3;
    -if(f = 4) { // This is identified by both `Wparentheses` and this check - should it have been: `if (f == 4)` ?
    -  f = f + 1;
    -}
    -
    -if((f == 5) || (f = 6)) { // the assignment here `(f = 6)` is identified by this check, but not by `-Wparentheses`. Should it have been `(f == 6)` ?
    -  f = f + 2;
    -}
    + Diagnostic text:

    +
      +
    • warning: %select{destination for|source of}0 this %1 call is a pointer to ownership-qualified type %2
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - bugprone-narrowing-conversions - bugprone-narrowing-conversions + clang-diagnostic-arc-repeated-use-of-weak + clang-diagnostic-arc-repeated-use-of-weak - -

    clang-tidy - bugprone-narrowing-conversions

    - -
    - -
    -

    bugprone-narrowing-conversions

    -

    The bugprone-narrowing-conversions check is an alias, please see cppcoreguidelines-narrowing-conversions for more information.

    + Diagnostic text:

    +
      +
    • warning: weak %select{variable|property|implicit property|instance variable}0 %1 is accessed multiple times in this %select{function|method|block|lambda}2 but may be unpredictably set to nil; assign to a strong variable to keep the object alive
    • +
    • warning: weak %select{variable|property|implicit property|instance variable}0 %1 may be accessed multiple times in this %select{function|method|block|lambda}2 and may be unpredictably set to nil; assign to a strong variable to keep the object alive
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - bugprone-standalone-empty - bugprone-standalone-empty + clang-diagnostic-arc-maybe-repeated-use-of-weak + clang-diagnostic-arc-maybe-repeated-use-of-weak - -

    clang-tidy - bugprone-standalone-empty

    - -

    bugprone-standalone-empty

    -

    Warns when empty() is used on a range and the result is ignored. Suggests clear() if it is an existing member function.

    -

    The empty() method on several common ranges returns a Boolean indicating whether or not the range is empty, but is often mistakenly interpreted as a way to clear the contents of a range. Some ranges offer a clear() method for this purpose. This check warns when a call to empty returns a result that is ignored, and suggests replacing it with a call to clear() if it is available as a member function of the range.

    -

    For example, the following code could be used to indicate whether a range is empty or not, but the result is ignored:

    -
    std::vector<int> v;
    -...
    -v.empty();
    -

    A call to clear() would appropriately clear the contents of the range:

    -
    std::vector<int> v;
    -...
    -v.clear();
    + Diagnostic text:

    +
      +
    • warning: weak %select{variable|property|implicit property|instance variable}0 %1 may be accessed multiple times in this %select{function|method|block|lambda}2 and may be unpredictably set to nil; assign to a strong variable to keep the object alive
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - bugprone-suspicious-realloc-usage - bugprone-suspicious-realloc-usage + clang-diagnostic-arc-retain-cycles + clang-diagnostic-arc-retain-cycles - -

    clang-tidy - bugprone-suspicious-realloc-usage

    - -

    bugprone-suspicious-realloc-usage

    -

    This check finds usages of realloc where the return value is assigned to the same expression as passed to the first argument: p = realloc(p, size); The problem with this construct is that if realloc fails it returns a null pointer but does not deallocate the original memory. If no other variable is pointing to it, the original memory block is not available any more for the program to use or free. In either case p = realloc(p, size); indicates bad coding style and can be replaced by q = realloc(p, size);.

    -

    The pointer expression (used at realloc) can be a variable or a field member of a data structure, but can not contain function calls or unresolved types.

    -

    In obvious cases when the pointer used at realloc is assigned to another variable before the realloc call, no warning is emitted. This happens only if a simple expression in form of q = p or void *q = p is found in the same function where p = realloc(p, ...) is found. The assignment has to be before the call to realloc (but otherwise at any place) in the same function. This suppression works only if p is a single variable.

    -

    Examples:

    -
    struct A {
    -  void *p;
    -};
    -
    -A &getA();
    -
    -void foo(void *p, A *a, int new_size) {
    -  p = realloc(p, new_size); // warning: 'p' may be set to null if 'realloc' fails, which may result in a leak of the original buffer
    -  a->p = realloc(a->p, new_size); // warning: 'a->p' may be set to null if 'realloc' fails, which may result in a leak of the original buffer
    -  getA().p = realloc(getA().p, new_size); // no warning
    -}
    -
    -void foo1(void *p, int new_size) {
    -  void *p1 = p;
    -  p = realloc(p, new_size); // no warning
    -}
    + Diagnostic text:

    +
      +
    • warning: capturing %0 strongly in this block is likely to lead to a retain cycle
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - bugprone-unchecked-optional-access - bugprone-unchecked-optional-access + clang-diagnostic-arc-unsafe-retained-assign + clang-diagnostic-arc-unsafe-retained-assign - -

    clang-tidy - bugprone-unchecked-optional-access

    - -

    bugprone-unchecked-optional-access

    -

    Note: This check uses a flow-sensitive static analysis to produce its results. Therefore, it may be more resource intensive (RAM, CPU) than the average clang-tidy check.

    -

    This check identifies unsafe accesses to values contained in std::optional<T>, absl::optional<T>, or base::Optional<T> objects. Below we will refer to all these types collectively as optional<T>.

    -

    An access to the value of an optional<T> occurs when one of its value, operator*, or operator-> member functions is invoked. To align with common misconceptions, the check considers these member functions as equivalent, even though there are subtle differences related to exceptions versus undefined behavior. See go/optional-style-recommendations for more information on that topic.

    -

    An access to the value of an optional<T> is considered safe if and only if code in the local scope (for example, a function body) ensures that the optional<T> has a value in all possible execution paths that can reach the access. That should happen either through an explicit check, using the optional<T>::has_value member function, or by constructing the optional<T> in a way that shows that it unambiguously holds a value (e.g using std::make_optional which always returns a populated std::optional<T>).

    -

    Below we list some examples, starting with unsafe optional access patterns, followed by safe access patterns.

    -

    Unsafe access patterns

    -

    Access the value without checking if it exists

    -

    The check flags accesses to the value that are not locally guarded by existence check:

    -
    void f(std::optional<int> opt) {
    -  use(*opt); // unsafe: it is unclear whether `opt` has a value.
    -}
    -

    Access the value in the wrong branch

    -

    The check is aware of the state of an optional object in different branches of the code. For example:

    -
    void f(std::optional<int> opt) {
    -  if (opt.has_value()) {
    -  } else {
    -    use(opt.value()); // unsafe: it is clear that `opt` does *not* have a value.
    -  }
    -}
    -

    Assume a function result to be stable

    -

    The check is aware that function results might not be stable. That is, consecutive calls to the same function might return different values. For example:

    -
    void f(Foo foo) {
    -  if (foo.opt().has_value()) {
    -    use(*foo.opt()); // unsafe: it is unclear whether `foo.opt()` has a value.
    -  }
    -}
    -

    Rely on invariants of uncommon APIs

    -

    The check is unaware of invariants of uncommon APIs. For example:

    -
    void f(Foo foo) {
    -  if (foo.HasProperty("bar")) {
    -    use(*foo.GetProperty("bar")); // unsafe: it is unclear whether `foo.GetProperty("bar")` has a value.
    -  }
    -}
    -

    Check if a value exists, then pass the optional to another function

    -

    The check relies on local reasoning. The check and value access must both happen in the same function. An access is considered unsafe even if the caller of the function performing the access ensures that the optional has a value. For example:

    -
    void g(std::optional<int> opt) {
    -  use(*opt); // unsafe: it is unclear whether `opt` has a value.
    -}
    -
    -void f(std::optional<int> opt) {
    -  if (opt.has_value()) {
    -    g(opt);
    -  }
    -}
    -

    Safe access patterns

    -

    Check if a value exists, then access the value

    -

    The check recognizes all straightforward ways for checking if a value exists and accessing the value contained in an optional object. For example:

    -
    void f(std::optional<int> opt) {
    -  if (opt.has_value()) {
    -    use(*opt);
    -  }
    -}
    -

    Check if a value exists, then access the value from a copy

    -

    The criteria that the check uses is semantic, not syntactic. It recognizes when a copy of the optional object being accessed is known to have a value. For example:

    -
    void f(std::optional<int> opt1) {
    -  if (opt1.has_value()) {
    -    std::optional<int> opt2 = opt1;
    -    use(*opt2);
    -  }
    -}
    -

    Ensure that a value exists using common macros

    -

    The check is aware of common macros like CHECK, DCHECK, and ASSERT_THAT. Those can be used to ensure that an optional object has a value. For example:

    -
    void f(std::optional<int> opt) {
    -  DCHECK(opt.has_value());
    -  use(*opt);
    -}
    -

    Ensure that a value exists, then access the value in a correlated branch

    -

    The check is aware of correlated branches in the code and can figure out when an optional object is ensured to have a value on all execution paths that lead to an access. For example:

    -
    void f(std::optional<int> opt) {
    -  bool safe = false;
    -  if (opt.has_value() && SomeOtherCondition()) {
    -    safe = true;
    -  }
    -  // ... more code...
    -  if (safe) {
    -    use(*opt);
    -  }
    -}
    -

    Stabilize function results

    -

    Since function results are not assumed to be stable across calls, it is best to store the result of the function call in a local variable and use that variable to access the value. For example:

    -
    void f(Foo foo) {
    -  if (const auto& foo_opt = foo.opt(); foo_opt.has_value()) {
    -    use(*foo_opt);
    -  }
    -}
    -

    Do not rely on uncommon-API invariants

    -

    When uncommon APIs guarantee that an optional has contents, do not rely on it --instead, check explicitly that the optional object has a value. For example:

    -
    void f(Foo foo) {
    -  if (const auto& property = foo.GetProperty("bar")) {
    -    use(*property);
    -  }
    -}
    -

    instead of the HasProperty, GetProperty pairing we saw above.

    -

    Do not rely on caller-performed checks

    -

    If you know that all of a function's callers have checked that an optional argument has a value, either change the function to take the value directly or check the optional again in the local scope of the callee. For example:

    -
    void g(int val) {
    -  use(val);
    -}
    -
    -void f(std::optional<int> opt) {
    -  if (opt.has_value()) {
    -    g(*opt);
    -  }
    -}
    -

    and

    -
    struct S {
    -  std::optional<int> opt;
    -  int x;
    -};
    -
    -void g(const S &s) {
    -  if (s.opt.has_value() && s.x > 10) {
    -    use(*s.opt);
    -}
    -
    -void f(S s) {
    -  if (s.opt.has_value()) {
    -    g(s);
    -  }
    -}
    -

    Additional notes

    -

    Aliases created via using declarations

    -

    The check is aware of aliases of optional types that are created via using declarations. For example:

    -
    using OptionalInt = std::optional<int>;
    -
    -void f(OptionalInt opt) {
    -  use(opt.value()); // unsafe: it is unclear whether `opt` has a value.
    -}
    -

    Lambdas

    -

    The check does not currently report unsafe optional accesses in lambdas. A future version will expand the scope to lambdas, following the rules outlined above. It is best to follow the same principles when using optionals in lambdas.

    + Diagnostic text:

    +
      +
    • warning: assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0 to a weak %select{property|variable}1; object will be released after assignment
    • +
    • warning: assigning retained object to %select{weak|unsafe_unretained}0 %select{property|variable}1; object will be released after assignment
    • +
    • warning: assigning retained object to unsafe property; object will be released after assignment
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - cert-msc54-cpp - cert-msc54-cpp + clang-diagnostic-asm + clang-diagnostic-asm - -

    clang-tidy - cert-msc54-cpp

    - -
    - -
    -

    cert-msc54-cpp

    -

    The cert-msc54-cpp check is an alias, please see bugprone-signal-handler for more information.

    + Diagnostic text:

    +
      +
    • warning: value size does not match register size specified by the constraint and modifier
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - cppcoreguidelines-avoid-const-or-ref-data-members - cppcoreguidelines-avoid-const-or-ref-data-members + clang-diagnostic-asm-operand-widths + clang-diagnostic-asm-operand-widths - -

    clang-tidy - cppcoreguidelines-avoid-const-or-ref-data-members

    - -

    cppcoreguidelines-avoid-const-or-ref-data-members

    -

    This check warns when structs or classes have const-qualified or reference (lvalue or rvalue) data members. Having such members is rarely useful, and makes the class only copy-constructible but not copy-assignable.

    -

    Examples:

    -
    // Bad, const-qualified member
    -struct Const {
    -  const int x;
    -}
    -
    -// Good:
    -class Foo {
    - public:
    -  int get() const { return x; }
    - private:
    -  int x;
    -};
    -
    -// Bad, lvalue reference member
    -struct Ref {
    -  int& x;
    -};
    -
    -// Good:
    -struct Foo {
    -  int* x;
    -  std::unique_ptr<int> x;
    -  std::shared_ptr<int> x;
    -  gsl::not_null<int> x;
    -};
    -
    -// Bad, rvalue reference member
    -struct RefRef {
    -  int&& x;
    -};
    -

    The check implements rule C.12 of C++ Core Guidelines.

    -

    Further reading: Data members: Never const.

    + Diagnostic text:

    +
      +
    • warning: value size does not match register size specified by the constraint and modifier
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - cppcoreguidelines-avoid-do-while - cppcoreguidelines-avoid-do-while + clang-diagnostic-avr-rtlib-linking-quirks + clang-diagnostic-avr-rtlib-linking-quirks - -

    clang-tidy - cppcoreguidelines-avoid-do-while

    - -

    cppcoreguidelines-avoid-do-while

    -

    Warns when using do-while loops. They are less readable than plain while loops, since the termination condition is at the end and the condition is not checked prior to the first iteration. This can lead to subtle bugs.

    -

    The check implements rule ES.75 of C++ Core Guidelines.

    -

    Examples:

    -
    int x;
    -do {
    -    std::cin >> x;
    -    // ...
    -} while (x < 0);
    -

    Options

    -
    -

    IgnoreMacros

    -

    Ignore the check when analyzing macros. This is useful for safely defining function-like macros:

    -
    #define FOO_BAR(x) \
    -do { \
    -  foo(x); \
    -  bar(x); \
    -} while(0)
    -

    Defaults to false.

    -
    -

    References

    -

    clang.llvm.org

    ]]> - -
    - INFO -
    - - cppcoreguidelines-macro-to-enum - cppcoreguidelines-macro-to-enum - - -

    clang-tidy - cppcoreguidelines-macro-to-enum

    - -
    - -
    -

    cppcoreguidelines-macro-to-enum

    -

    The cppcoreguidelines-macro-to-enum check is an alias, please see modernize-macro-to-enum <../modernize/macro-to-enum> for more information.

    + Diagnostic text:

    +
      +
    • warning: no avr-libc installation can be found on the system, cannot link standard libraries
    • +
    • warning: no target microcontroller specified on command line, cannot link standard libraries, please pass -mmcu=<mcu name>
    • +
    • warning: standard library not linked and so no interrupt vector table or compiler runtime routines will be linked
    • +
    • warning: support for linking stdlibs for microcontroller '%0' is not implemented
    • +
    • warning: support for passing the data section address to the linker for microcontroller '%0' is not implemented
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - misc-confusable-identifiers - misc-confusable-identifiers + clang-diagnostic-absolute-value + clang-diagnostic-absolute-value - -

    clang-tidy - misc-confusable-identifiers

    - -

    misc-confusable-identifiers

    -

    Warn about confusable identifiers, i.e. identifiers that are visually close to each other, but use different Unicode characters. This detects a potential attack described in CVE-2021-42574.

    -

    Example:

    -
    int fo; // Initial character is U+0066 (LATIN SMALL LETTER F).
    -int fo; // Initial character is U+1D41F (MATHEMATICAL BOLD SMALL F) not U+0066 (LATIN SMALL LETTER F).
    + Diagnostic text:

    +
      +
    • warning: absolute value function %0 given an argument of type %1 but has parameter of type %2 which may cause truncation of value
    • +
    • warning: taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious
    • +
    • warning: taking the absolute value of unsigned type %0 has no effect
    • +
    • warning: using %select{integer|floating point|complex}1 absolute value function %0 when argument is of %select{integer|floating point|complex}2 type
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - misc-const-correctness - misc-const-correctness + clang-diagnostic-abstract-final-class + clang-diagnostic-abstract-final-class - -

    clang-tidy - misc-const-correctness

    - -

    misc-const-correctness

    -

    This check implements detection of local variables which could be declared as const but are not. Declaring variables as const is required or recommended by many coding guidelines, such as: CppCoreGuidelines ES.25 and AUTOSAR C++14 Rule A7-1-1 (6.7.1 Specifiers).

    -

    Please note that this check's analysis is type-based only. Variables that are not modified but used to create a non-const handle that might escape the scope are not diagnosed as potential const.

    -
    // Declare a variable, which is not ``const`` ...
    -int i = 42;
    -// but use it as read-only. This means that `i` can be declared ``const``.
    -int result = i * i;       // Before transformation
    -int const result = i * i; // After transformation
    -

    The check can analyze values, pointers and references but not (yet) pointees:

    -
    // Normal values like built-ins or objects.
    -int potential_const_int = 42;       // Before transformation
    -int const potential_const_int = 42; // After transformation
    -int copy_of_value = potential_const_int;
    -
    -MyClass could_be_const;       // Before transformation
    -MyClass const could_be_const; // After transformation
    -could_be_const.const_qualified_method();
    -
    -// References can be declared const as well.
    -int &reference_value = potential_const_int;       // Before transformation
    -int const& reference_value = potential_const_int; // After transformation
    -int another_copy = reference_value;
    -
    -// The similar semantics of pointers are not (yet) analyzed.
    -int *pointer_variable = &potential_const_int; // _NO_ 'const int *pointer_variable' suggestion.
    -int last_copy = *pointer_variable;
    -

    The automatic code transformation is only applied to variables that are declared in single declarations. You may want to prepare your code base with readability-isolate-declaration first.

    -

    Note that there is the check cppcoreguidelines-avoid-non-const-global-variables to enforce const correctness on all globals.

    -

    Known Limitations

    -

    The check does not run on C code.

    -

    The check will not analyze templated variables or variables that are instantiation dependent. Different instantiations can result in different const correctness properties and in general it is not possible to find all instantiations of a template. The template might be used differently in an independent translation unit.

    -

    Pointees can not be analyzed for constness yet. The following code shows this limitation.

    -
    // Declare a variable that will not be modified.
    -int constant_value = 42;
    -
    -// Declare a pointer to that variable, that does not modify either, but misses 'const'.
    -// Could be 'const int *pointer_to_constant = &constant_value;'
    -int *pointer_to_constant = &constant_value;
    -
    -// Usage:
    -int result = 520 * 120 * (*pointer_to_constant);
    -

    This limitation affects the capability to add const to methods which is not possible, too.

    -

    Options

    -
    -

    AnalyzeValues (default = true)

    -

    Enable or disable the analysis of ordinary value variables, like int i = 42;

    -
    // Warning
    -int i = 42;
    -// No warning
    -int const i = 42;
    -
    -// Warning
    -int a[] = {42, 42, 42};
    -// No warning
    -int const a[] = {42, 42, 42};
    -
    -
    -

    AnalyzeReferences (default = true)

    -

    Enable or disable the analysis of reference variables, like int &ref = i;

    -
    int i = 42;
    -// Warning
    -int& ref = i;
    -// No warning
    -int const& ref = i;
    -
    -
    -

    WarnPointersAsValues (default = false)

    -

    This option enables the suggestion for const of the pointer itself. Pointer values have two possibilities to be const, the pointer and the value pointing to.

    -
    int value = 42;
    -
    -// Warning
    -const int * pointer_variable = &value;
    -// No warning
    -const int *const pointer_variable = &value;
    -
    -
    -

    TransformValues (default = true)

    -

    Provides fixit-hints for value types that automatically add const if its a single declaration.

    -
    // Before
    -int value = 42;
    -// After
    -int const value = 42;
    -
    -// Before
    -int a[] = {42, 42, 42};
    -// After
    -int const a[] = {42, 42, 42};
    -
    -// Result is modified later in its life-time. No diagnostic and fixit hint will be emitted.
    -int result = value * 3;
    -result -= 10;
    -
    -
    -

    TransformReferences (default = true)

    -

    Provides fixit-hints for reference types that automatically add const if its a single declaration.

    -
    // This variable could still be a constant. But because there is a non-const reference to
    -// it, it can not be transformed (yet).
    -int value = 42;
    -// The reference 'ref_value' is not modified and can be made 'const int &ref_value = value;'
    -// Before
    -int &ref_value = value;
    -// After
    -int const &ref_value = value;
    -
    -// Result is modified later in its life-time. No diagnostic and fixit hint will be emitted.
    -int result = ref_value * 3;
    -result -= 10;
    -
    -
    -

    TransformPointersAsValues (default = false)

    -

    Provides fixit-hints for pointers if their pointee is not changed. This does not analyze if the value-pointed-to is unchanged!

    -

    Requires 'WarnPointersAsValues' to be 'true'.

    -
    int value = 42;
    -
    -// Before
    -const int * pointer_variable = &value;
    -// After
    -const int *const pointer_variable = &value;
    -
    -// Before
    -const int * a[] = {&value, &value};
    -// After
    -const int *const a[] = {&value, &value};
    -
    -// Before
    -int *ptr_value = &value;
    -// After
    -int *const ptr_value = &value;
    -
    -int result = 100 * (*ptr_value); // Does not modify the pointer itself.
    -// This modification of the pointee is still allowed and not diagnosed.
    -*ptr_value = 0;
    -
    -// The following pointer may not become a 'int *const'.
    -int *changing_pointee = &value;
    -changing_pointee = &result;
    -
    + Diagnostic text:

    +
      +
    • warning: abstract class is marked '%select{final|sealed}0'
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - misc-use-anonymous-namespace - misc-use-anonymous-namespace + clang-diagnostic-address-of-temporary + clang-diagnostic-address-of-temporary - -

    clang-tidy - misc-use-anonymous-namespace

    - -

    misc-use-anonymous-namespace

    -

    Finds instances of static functions or variables declared at global scope that could instead be moved into an anonymous namespace.

    -

    Anonymous namespaces are the "superior alternative" according to the C++ Standard. static was proposed for deprecation, but later un-deprecated to keep C compatibility [1]. static is an overloaded term with different meanings in different contexts, so it can create confusion.

    -

    The following uses of static will not be diagnosed:

    + Diagnostic text:

      -
    • Functions or variables in header files, since anonymous namespaces in headers is considered an antipattern. Allowed header file extensions can be configured via the HeaderFileExtensions option (see below).
    • -
    • const or constexpr variables, since they already have implicit internal linkage in C++.
    • +
    • warning: taking the address of a temporary object of type %0
    -

    Examples:

    -
    // Bad
    -static void foo();
    -static int x;
    -
    -// Good
    -namespace {
    -  void foo();
    -  int x;
    -} // namespace
    -

    Options

    -
    -

    HeaderFileExtensions

    -

    A semicolon-separated list of filename extensions of header files (the filename extensions should not include "." prefix). Default is ";h;hh;hpp;hxx". For extension-less header files, using an empty string or leaving an empty string between ";" if there are other filename extensions.

    -
    -

    [1] Undeprecating static

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - modernize-macro-to-enum - modernize-macro-to-enum + clang-diagnostic-all + clang-diagnostic-all - -

    clang-tidy - modernize-macro-to-enum

    - -

    modernize-macro-to-enum

    -

    Replaces groups of adjacent macros with an unscoped anonymous enum. Using an unscoped anonymous enum ensures that everywhere the macro token was used previously, the enumerator name may be safely used.

    -

    This check can be used to enforce the C++ core guideline Enum.1: Prefer enumerations over macros, within the constraints outlined below.

    -

    Potential macros for replacement must meet the following constraints:

    + Diagnostic text:

      -
    • Macros must expand only to integral literal tokens or expressions of literal tokens. The expression may contain any of the unary operators -, +, ~ or !, any of the binary operators ,, -, +, *, /, %, &, |, ^, <, >, <=, >=, ==, !=, ||, &&, <<, >> or <=>, the ternary operator ?: and its GNU extension. Parenthesized expressions are also recognized. This recognizes most valid expressions. In particular, expressions with the sizeof operator are not recognized.
    • -
    • Macros must be defined on sequential source file lines, or with only comment lines in between macro definitions.
    • -
    • Macros must all be defined in the same source file.
    • -
    • Macros must not be defined within a conditional compilation block. (Conditional include guards are exempt from this constraint.)
    • -
    • Macros must not be defined adjacent to other preprocessor directives.
    • -
    • Macros must not be used in any conditional preprocessing directive.
    • -
    • Macros must not be used as arguments to other macros.
    • -
    • Macros must not be undefined.
    • -
    • Macros must be defined at the top-level, not inside any declaration or definition.
    • -
    -

    Each cluster of macros meeting the above constraints is presumed to be a set of values suitable for replacement by an anonymous enum. From there, a developer can give the anonymous enum a name and continue refactoring to a scoped enum if desired. Comments on the same line as a macro definition or between subsequent macro definitions are preserved in the output. No formatting is assumed in the provided replacements, although clang-tidy can optionally format all fixes.

    -
    -
    -

    Warning

    -
    -

    Initializing expressions are assumed to be valid initializers for an enum. C requires that enum values fit into an int, but this may not be the case for some accepted constant expressions. For instance 1 << 40 will not fit into an int when the size of an int is 32 bits.

    -
    -

    Examples:

    -
    #define RED   0xFF0000
    -#define GREEN 0x00FF00
    -#define BLUE  0x0000FF
    -
    -#define TM_NONE (-1) // No method selected.
    -#define TM_ONE 1    // Use tailored method one.
    -#define TM_TWO 2    // Use tailored method two.  Method two
    -                    // is preferable to method one.
    -#define TM_THREE 3  // Use tailored method three.
    -

    becomes

    -
    enum {
    -RED = 0xFF0000,
    -GREEN = 0x00FF00,
    -BLUE = 0x0000FF
    -};
    -
    -enum {
    -TM_NONE = (-1), // No method selected.
    -TM_ONE = 1,    // Use tailored method one.
    -TM_TWO = 2,    // Use tailored method two.  Method two
    -                    // is preferable to method one.
    -TM_THREE = 3  // Use tailored method three.
    -};
    +
  • warning: #pragma execution_character_set expected '%0'
  • +
  • warning: #pragma execution_character_set expected 'push' or 'pop'
  • +
  • warning: #pragma execution_character_set invalid value '%0', only 'UTF-8' is supported
  • +
  • warning: #pragma warning expected '%0'
  • +
  • warning: #pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4
  • +
  • warning: #pragma warning expected a warning number
  • +
  • warning: #pragma warning(push, level) requires a level between 0 and 4
  • +
  • warning: %0
  • +
  • warning: %0 has C-linkage specified, but returns incomplete type %1 which could be incompatible with C
  • +
  • warning: %0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C
  • +
  • warning: %0 has lower precedence than %1; %1 will be evaluated first
  • +
  • warning: %2 defined as %select{a struct|an interface|a class}0%select{| template}1 here but previously declared as %select{a struct|an interface|a class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
  • +
  • warning: %plural{1:enumeration value %1 not handled in switch|2:enumeration values %1 and %2 not handled in switch|3:enumeration values %1, %2, and %3 not handled in switch|:%0 enumeration values not handled in switch: %1, %2, %3...}0
  • +
  • warning: %q0 hides overloaded virtual %select{function|functions}1
  • +
  • warning: %select{aligning a value|the result of checking whether a value is aligned}0 to 1 byte is %select{a no-op|always true}0
  • +
  • warning: %select{delete|destructor}0 called on %1 that is abstract but has non-virtual destructor
  • +
  • warning: %select{delete|destructor}0 called on non-final %1 that has virtual functions but non-virtual destructor
  • +
  • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
  • +
  • warning: %select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior
  • +
  • warning: %select{field|base class}0 %1 will be initialized after %select{field|base}2 %3
  • +
  • warning: %select{function|variable}0 %1 is not needed and will not be emitted
  • +
  • warning: %select{self-|array }0comparison always evaluates to %select{a constant|true|false|'std::strong_ordering::equal'}1
  • +
  • warning: %select{struct|interface|class}0%select{| template}1 %2 was previously declared as a %select{struct|interface|class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
  • +
  • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
  • +
  • warning: %select{void function|void method|constructor|destructor}1 %0 should not return a value
  • +
  • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++
  • +
  • warning: %sub{subst_format_overflow}0,1,2
  • +
  • warning: %sub{subst_format_overflow}0,1,2
  • +
  • warning: %sub{subst_format_truncation}0,1,2
  • +
  • warning: %sub{subst_format_truncation}0,1,2
  • +
  • warning: '%%n' specifier not supported on this platform
  • +
  • warning: '%0' is not a valid object format flag
  • +
  • warning: '%0' within '%1'
  • +
  • warning: '%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument
  • +
  • warning: '&&' of a value and its negation always evaluates to false
  • +
  • warning: '&&' within '||'
  • +
  • warning: '/*' within block comment
  • +
  • warning: 'static' function %0 declared in header file should be declared 'static inline'
  • +
  • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
  • +
  • warning: '||' of a value and its negation always evaluates to true
  • +
  • warning: // comments are not allowed in this language
  • +
  • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0
  • +
  • warning: add explicit braces to avoid dangling else
  • +
  • warning: adding %0 to a string does not append to the string
  • +
  • warning: all paths through this function will call itself
  • +
  • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
  • +
  • warning: argument %0 of type %1 with mismatched bound
  • +
  • warning: array section %select{lower bound|length}0 is of type 'char'
  • +
  • warning: array subscript is of type 'char'
  • +
  • warning: assigning %select{field|instance variable}0 to itself
  • +
  • warning: base class %0 is uninitialized when used here to access %q1
  • +
  • warning: bitwise comparison always evaluates to %select{false|true}0
  • +
  • warning: bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 did you mean logical negation?
  • +
  • warning: bitwise or with non-zero value always evaluates to true
  • +
  • warning: block pointer variable %0 is %select{uninitialized|null}1 when captured by block
  • +
  • warning: call to undeclared function %0; ISO C99 and later do not support implicit function declarations
  • +
  • warning: call to undeclared library function '%0' with type %1; ISO C99 and later do not support implicit function declarations
  • +
  • warning: calling '%0' with a nonzero argument is unsafe
  • +
  • warning: cannot mix positional and non-positional arguments in format string
  • +
  • warning: case value not in enumerated type %0
  • +
  • warning: cast of type %0 to %1 is deprecated; use sel_getName instead
  • +
  • warning: comparison of %select{address of|function|array}0 '%1' %select{not |}2equal to a null pointer is always %select{true|false}2
  • +
  • warning: comparison of nonnull %select{function call|parameter}0 '%1' %select{not |}2equal to a null pointer is '%select{true|false}2' on first encounter
  • +
  • warning: container access result unused - container access should not be used for side effects
  • +
  • warning: convenience initializer missing a 'self' call to another initializer
  • +
  • warning: convenience initializer should not invoke an initializer on 'super'
  • +
  • warning: converting the enum constant to a boolean
  • +
  • warning: converting the result of '<<' to a boolean always evaluates to %select{false|true}0
  • +
  • warning: converting the result of '<<' to a boolean; did you mean '(%0) != 0'?
  • +
  • warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true'
  • +
  • warning: data argument not used by format string
  • +
  • warning: data argument position '%0' exceeds the number of data arguments (%1)
  • +
  • warning: designated initializer invoked a non-designated initializer
  • +
  • warning: designated initializer missing a 'super' call to a designated initializer of the super class
  • +
  • warning: designated initializer should only invoke a designated initializer on 'super'
  • +
  • warning: double-quoted include "%0" cannot be aliased to angle-bracketed include <%1>
  • +
  • warning: equality comparison with extraneous parentheses
  • +
  • warning: escaped newline between */ characters at block comment end
  • +
  • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
  • +
  • warning: expected end of directive in pragma
  • +
  • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1
  • +
  • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1
  • +
  • warning: explicitly moving variable of type %0 to itself%select{|; did you mean to move to member %2?}1
  • +
  • warning: explicitly moving variable of type %0 to itself%select{|; did you mean to move to member %2?}1
  • +
  • warning: expression result unused
  • +
  • warning: expression result unused; should this cast be to 'void'?
  • +
  • warning: expression with side effects has no effect in an unevaluated context
  • +
  • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
  • +
  • warning: field %0 can overwrite instance variable %1 with variable sized type %2 in superclass %3
  • +
  • warning: field %0 is uninitialized when used here
  • +
  • warning: field %0 with variable sized type %1 is not visible to subclasses and can conflict with their instance variables
  • +
  • warning: field %select{width|precision}0 should have type %1, but argument has type %2
  • +
  • warning: flag '%0' is ignored when flag '%1' is present
  • +
  • warning: flag '%0' results in undefined behavior with '%1' conversion specifier
  • +
  • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1
  • +
  • warning: format string contains '\0' within the string body
  • +
  • warning: format string is empty
  • +
  • warning: format string is not a string literal (potentially insecure)
  • +
  • warning: format string is not null-terminated
  • +
  • warning: format string missing
  • +
  • warning: format string should not be a wide string
  • +
  • warning: ignored trigraph would end block comment
  • +
  • warning: ignoring return value of function declared with %0 attribute
  • +
  • warning: ignoring return value of function declared with %0 attribute
  • +
  • warning: ignoring return value of function declared with %0 attribute: %1
  • +
  • warning: ignoring temporary created by a constructor declared with %0 attribute
  • +
  • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
  • +
  • warning: implicit declaration of function %0
  • +
  • warning: implicitly declaring library function '%0' with type %1
  • +
  • warning: incomplete format specifier
  • +
  • warning: initializer order does not match the declaration order
  • +
  • warning: invalid conversion specifier '%0'
  • +
  • warning: invalid position specified for %select{field width|field precision}0
  • +
  • warning: ivar %0 which backs the property is not referenced in this property's accessor
  • +
  • warning: lambda capture %0 is not %select{used|required to be captured for this use}1
  • +
  • warning: left operand of comma operator has no effect
  • +
  • warning: length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier
  • +
  • warning: logical not is only applied to the left hand side of this %select{comparison|bitwise operator}0
  • +
  • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
  • +
  • warning: loop variable %0 creates a copy from type %1
  • +
  • warning: method override for the designated initializer of the superclass %objcinstance0 not found
  • +
  • warning: method possibly missing a [super %0] call
  • +
  • warning: misleading indentation; statement is not part of the previous '%select{if|else|for|while}0'
  • +
  • warning: missing object format flag
  • +
  • warning: more '%%' conversions than data arguments
  • +
  • warning: moving a local object in a return statement prevents copy elision
  • +
  • warning: moving a temporary object prevents copy elision
  • +
  • warning: multi-character character constant
  • +
  • warning: multi-line // comment
  • +
  • warning: no closing ']' for '%%[' in scanf format string
  • +
  • warning: non-void %select{function|method}1 %0 should return a value
  • +
  • warning: non-void %select{function|method}1 %0 should return a value
  • +
  • warning: non-void coroutine does not return a value
  • +
  • warning: non-void coroutine does not return a value in all control paths
  • +
  • warning: non-void function does not return a value
  • +
  • warning: non-void function does not return a value in all control paths
  • +
  • warning: non-void lambda does not return a value
  • +
  • warning: non-void lambda does not return a value in all control paths
  • +
  • warning: not packing field %0 as it is non-POD for the purposes of layout
  • +
  • warning: null passed to a callee that requires a non-null argument
  • +
  • warning: null returned from %select{function|method}0 that requires a non-null return value
  • +
  • warning: object format flags cannot be used with '%0' conversion specifier
  • +
  • warning: operator '%0' has lower precedence than '%1'; '%1' will be evaluated first
  • +
  • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
  • +
  • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
  • +
  • warning: overflow converting case value to switch condition type (%0 to %1)
  • +
  • warning: overlapping comparisons always evaluate to %select{false|true}0
  • +
  • warning: overloaded operator %select{>>|<<}0 has higher precedence than comparison operator
  • +
  • warning: parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not support implicit int
  • +
  • warning: position arguments in format strings start counting at 1 (not 0)
  • +
  • warning: pragma STDC FENV_ROUND is not supported
  • +
  • warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'
  • +
  • warning: pragma diagnostic expected option name (e.g. "-Wundef")
  • +
  • warning: pragma diagnostic pop could not pop, no matching push
  • +
  • warning: pragma include_alias expected '%0'
  • +
  • warning: pragma include_alias expected include filename
  • +
  • warning: private field %0 is not used
  • +
  • warning: redundant move in return statement
  • +
  • warning: reference %0 is not yet bound to a value when used here
  • +
  • warning: reference %0 is not yet bound to a value when used within its own initialization
  • +
  • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
  • +
  • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
  • +
  • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
  • +
  • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO
  • +
  • warning: sizeof on array function parameter will return size of %0 instead of %1
  • +
  • warning: sizeof on pointer operation will return size of %0 instead of %1
  • +
  • warning: static variable %0 is suspiciously used within its own initialization
  • +
  • warning: suggest braces around initialization of subobject
  • +
  • warning: switch condition has boolean value
  • +
  • warning: trigraph converted to '%0' character
  • +
  • warning: trigraph ends block comment
  • +
  • warning: trigraph ignored
  • +
  • warning: type specifier missing, defaults to 'int'
  • +
  • warning: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int
  • +
  • warning: unexpected token in pragma diagnostic
  • +
  • warning: unknown pragma ignored
  • +
  • warning: unknown pragma in STDC namespace
  • +
  • warning: unused %select{typedef|type alias}0 %1
  • +
  • warning: unused function %0
  • +
  • warning: unused label %0
  • +
  • warning: unused variable %0
  • +
  • warning: unused variable %0
  • +
  • warning: use of __private_extern__ on a declaration may not produce external symbol private to the linkage unit and is deprecated
  • +
  • warning: use of bitwise '%0' with boolean operands
  • +
  • warning: use of unknown builtin %0
  • +
  • warning: using '%%P' format specifier without precision
  • +
  • warning: using '%0' format specifier annotation outside of os_log()/os_trace()
  • +
  • warning: using '%0' format specifier, but argument has boolean value
  • +
  • warning: using the result of an assignment as a condition without parentheses
  • +
  • warning: variable %0 is %select{decremented|incremented}1 both in the loop header and in the loop body
  • +
  • warning: variable %0 is %select{used|captured}1 uninitialized whenever %select{'%3' condition is %select{true|false}4|'%3' loop %select{is entered|exits because its condition is false}4|'%3' loop %select{condition is true|exits because its condition is false}4|switch %3 is taken|its declaration is reached|%3 is called}2
  • +
  • warning: variable %0 is uninitialized when %select{used here|captured by block}1
  • +
  • warning: variable %0 is uninitialized when passed as a const reference argument here
  • +
  • warning: variable %0 is uninitialized when used within its own initialization
  • +
  • warning: variable %0 set but not used
  • +
  • warning: variable length arrays in C++ are a Clang extension
  • +
  • warning: variable length arrays in C++ are a Clang extension
  • +
  • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
  • +
  • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
  • +
  • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body
  • +
  • warning: zero field width in scanf format string is unused
  • + +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + CRITICAL +
    + + clang-diagnostic-always-inline-coroutine + clang-diagnostic-always-inline-coroutine + + Diagnostic text:

    +
      +
    • warning: this coroutine may be split into pieces; not every piece is guaranteed to be inlined
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-ambiguous-member-template + clang-diagnostic-ambiguous-member-template + + Diagnostic text:

    +
      +
    • warning: lookup of %0 in member access expression is ambiguous; using member of %1
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-ambiguous-macro + clang-diagnostic-ambiguous-macro + + Diagnostic text:

    +
      +
    • warning: ambiguous expansion of macro %0
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-anon-enum-enum-conversion + clang-diagnostic-anon-enum-enum-conversion + + Diagnostic text:

    +
      +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-array-bounds + clang-diagnostic-array-bounds + + Diagnostic text:

    +
      +
    • warning: array argument is too small; %select{contains %0 elements|is of size %0}2, callee requires at least %1
    • +
    • warning: array index %0 is before the beginning of the array
    • +
    • warning: array index %0 is past the end of the array (that has type %1%select{|, cast to %3}2)
    • +
    • warning: array index %0 refers past the last possible element for an array in %1-bit address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)
    • +
    • warning: the pointer incremented by %0 refers past the last possible element for an array in %1-bit address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-array-bounds-pointer-arithmetic + clang-diagnostic-array-bounds-pointer-arithmetic + + Diagnostic text:

    +
      +
    • warning: the pointer decremented by %0 refers before the beginning of the array
    • +
    • warning: the pointer incremented by %0 refers past the end of the array (that has type %1)
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-array-parameter + clang-diagnostic-array-parameter + + Diagnostic text:

    +
      +
    • warning: argument %0 of type %1 with mismatched bound
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-atomic-alignment + clang-diagnostic-atomic-alignment + + Diagnostic text:

    +
      +
    • warning: large atomic operation may incur significant performance penalty; the access size (%0 bytes) exceeds the max lock-free size (%1 bytes)
    • +
    • warning: misaligned atomic operation may incur significant performance penalty; the expected alignment (%0 bytes) exceeds the actual alignment (%1 bytes)
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-atomic-properties + clang-diagnostic-atomic-properties + + Diagnostic text:

    +
      +
    • warning: atomic by default property %0 has a user defined %select{getter|setter}1 (property should be marked 'atomic' if this is intended)
    • +
    • warning: property is assumed atomic by default
    • +
    • warning: property is assumed atomic when auto-synthesizing the property
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-attributes + clang-diagnostic-attributes + + Diagnostic text:

    +
      +
    • warning: %0 attribute argument '%1' not supported on a global variable
    • +
    • warning: %0 attribute argument not supported: %1
    • +
    • warning: %0 attribute can only be applied to instance variables or properties
    • +
    • warning: %0 attribute ignored
    • +
    • warning: %0 attribute ignored for field of type %1
    • +
    • warning: %0 attribute ignored on a non-definition declaration
    • +
    • warning: %0 attribute ignored on inline function
    • +
    • warning: %0 attribute ignored when parsing type
    • +
    • warning: %0 attribute is deprecated and ignored in %1
    • +
    • warning: %0 attribute is ignored because %1 is not a function pointer
    • +
    • warning: %0 attribute is ignored because there exists no call expression inside the statement
    • +
    • warning: %0 attribute isn't implemented by this Objective-C runtime
    • +
    • warning: %0 attribute only applies to %select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters
    • +
    • warning: %0 attribute only applies to %select{functions|methods|properties}1 that return %select{an Objective-C object|a pointer|a non-retainable pointer}2
    • +
    • warning: %0 attribute only applies to a pointer or reference (%1 is invalid)
    • +
    • warning: %0 attribute only applies to return values that are pointers
    • +
    • warning: %0 attribute only applies to return values that are pointers or references
    • +
    • warning: %0 attribute only applies to%select{| constant}1 pointer arguments
    • +
    • warning: %0 calling convention is not supported %select{for this target|on variadic function|on constructor/destructor|on builtin function}1
    • +
    • warning: %0 currently has no effect on a using declaration
    • +
    • warning: %0%select{ attribute|}1 only applies to %2
    • +
    • warning: %0%select{ attribute|}1 only applies to %select{functions|unions|variables and functions|functions and methods|functions, methods and blocks|functions, methods, and parameters|variables|variables and fields|variables, data members and tag types|types and namespaces|variables, functions and classes|kernel functions|non-K&R-style functions}2
    • +
    • warning: %q0 redeclared inline; %1 attribute ignored
    • +
    • warning: %select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to functions that have %select{no parameters|a 'void' return type}1
    • +
    • warning: %select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2
    • +
    • warning: %select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden
    • +
    • warning: %select{alignment|size}0 of field %1 (%2 bits) does not match the %select{alignment|size}0 of the first field in transparent union; transparent_union attribute ignored
    • +
    • warning: %select{unsupported|duplicate|unknown}0%select{| CPU| tune CPU}1 '%2' in the '%select{target|target_clones|target_version}3' attribute string; '%select{target|target_clones|target_version}3' attribute ignored
    • +
    • warning: '%0' attribute cannot be specified on a definition
    • +
    • warning: '%0' only applies to %select{function|pointer|Objective-C object or block pointer}1 types; type here is %2
    • +
    • warning: '%select{pure|const}0' attribute on function returning 'void'; attribute ignored
    • +
    • warning: '[[%select{nodiscard|gnu::warn_unused_result}0]]' attribute ignored when applied to a typedef; consider using '__attribute__((warn_unused_result))' or '[[clang::warn_unused_result]]' instead
    • +
    • warning: '__clang__' is a predefined macro name, not an attribute scope specifier; did you mean '_Clang' instead?
    • +
    • warning: 'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored
    • +
    • warning: 'cmse_nonsecure_entry' cannot be applied to functions with internal linkage
    • +
    • warning: 'const' attribute imposes more restrictions; 'pure' attribute ignored
    • +
    • warning: 'deprecated' attribute on anonymous namespace ignored
    • +
    • warning: 'dllexport' attribute ignored on explicit instantiation definition
    • +
    • warning: 'gnu_inline' attribute requires function to be marked 'inline', attribute ignored
    • +
    • warning: 'internal_linkage' attribute on a non-static local variable is ignored
    • +
    • warning: 'mig_server_routine' attribute only applies to routines that return a kern_return_t
    • +
    • warning: 'nocf_check' attribute ignored; use -fcf-protection to enable the attribute
    • +
    • warning: 'noderef' can only be used on an array or pointer type
    • +
    • warning: 'nonnull' attribute applied to function with no pointer arguments
    • +
    • warning: 'nonnull' attribute when used on parameters takes no arguments
    • +
    • warning: 'nothrow' attribute conflicts with exception specification; attribute ignored
    • +
    • warning: 'objc_externally_retained' can only be applied to local variables %select{of retainable type|with strong ownership}0
    • +
    • warning: 'require_constant_initialization' attribute added after initialization of variable
    • +
    • warning: 'sentinel' attribute only supported for variadic %select{functions|blocks}0
    • +
    • warning: 'sentinel' attribute requires named arguments
    • +
    • warning: 'sycl_kernel' attribute only applies to a function template with at least two template parameters
    • +
    • warning: 'trivial_abi' cannot be applied to %0
    • +
    • warning: Objective-C GC does not allow weak variables on the stack
    • +
    • warning: __declspec attribute %0 is not supported
    • +
    • warning: __weak attribute cannot be specified on a field declaration
    • +
    • warning: __weak attribute cannot be specified on an automatic variable when ARC is not enabled
    • +
    • warning: attribute %0 after definition is ignored
    • +
    • warning: attribute %0 cannot be applied to %select{functions|Objective-C method}1 without return value
    • +
    • warning: attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement
    • +
    • warning: attribute %0 has no effect when annotating an infinite loop
    • +
    • warning: attribute %0 ignored, because it cannot be applied to a type
    • +
    • warning: attribute %0 ignored, because it cannot be applied to omitted return type
    • +
    • warning: attribute %0 ignored, because it is not attached to a declaration
    • +
    • warning: attribute %0 is already applied
    • +
    • warning: attribute %0 is already applied with different arguments
    • +
    • warning: attribute %0 is ignored, place it after "%select{class|struct|interface|union|enum|enum class|enum struct}1" to apply attribute to type declaration
    • +
    • warning: attribute declaration must precede definition
    • +
    • warning: attribute is ignored on this statement as it only applies to functions; use '%0' on statements
    • +
    • warning: conflicting attributes %0 are ignored
    • +
    • warning: direct attribute on property %0 ignored (not implemented by this Objective-C runtime)
    • +
    • warning: first field of a transparent union cannot have %select{floating point|vector}0 type %1; transparent_union attribute ignored
    • +
    • warning: function template with 'sycl_kernel' attribute must have a 'void' return type
    • +
    • warning: function template with 'sycl_kernel' attribute must have a single parameter
    • +
    • warning: ignoring __declspec(allocator) because the function return type %0 is not a pointer or reference type
    • +
    • warning: import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the previous declaration
    • +
    • warning: import %select{module|name}0 cannot be applied to a function with a definition
    • +
    • warning: inheritance model ignored on %select{primary template|partial specialization}0
    • +
    • warning: maxclusterrank requires sm_90 or higher, CUDA arch provided: %0, ignoring %1 attribute
    • +
    • warning: qualifiers after comma in declarator list are ignored
    • +
    • warning: repeated RISC-V 'interrupt' attribute
    • +
    • warning: requested alignment is less than minimum alignment of %1 for type %0
    • +
    • warning: statement attribute %0 has higher precedence than function attribute '%select{always_inline|flatten|noinline}1'
    • +
    • warning: template parameter of a function template with the 'sycl_kernel' attribute cannot be a non-type template parameter
    • +
    • warning: transparent union definition must contain at least one field; transparent_union attribute ignored
    • +
    • warning: transparent_union attribute can only be applied to a union definition; attribute ignored
    • +
    • warning: unknown attribute %0 ignored
    • +
    • warning: unknown attribute '%0'
    • +
    • warning: unknown visibility %0
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-auto-disable-vptr-sanitizer + clang-diagnostic-auto-disable-vptr-sanitizer + + Diagnostic text:

    +
      +
    • warning: implicitly disabling vptr sanitizer because rtti wasn't enabled
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-auto-import + clang-diagnostic-auto-import + + Diagnostic text:

    +
      +
    • warning: treating #%select{include|import|include_next|__include_macros}0 as an import of module '%1'
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-arc + clang-diagnostic-arc + + Diagnostic text:

    +
      +
    • warning: %select{destination for|source of}0 this %1 call is a pointer to ownership-qualified type %2
    • +
    • warning: assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0 to a weak %select{property|variable}1; object will be released after assignment
    • +
    • warning: assigning retained object to %select{weak|unsafe_unretained}0 %select{property|variable}1; object will be released after assignment
    • +
    • warning: assigning retained object to unsafe property; object will be released after assignment
    • +
    • warning: capturing %0 strongly in this block is likely to lead to a retain cycle
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-availability + clang-diagnostic-availability + + Diagnostic text:

    +
      +
    • warning: %select{|overriding }1method cannot be unavailable on %0 when %select{the protocol method it implements|its overridden method}1 is available
    • +
    • warning: %select{|overriding }4method %select{introduced after|deprecated before|obsoleted before}0 %select{the protocol method it implements|overridden method}4 on %1 (%2 vs. %3)
    • +
    • warning: 'unavailable' availability overrides all other availability information
    • +
    • warning: Fuchsia API Level prohibits specifying a minor or sub-minor version
    • +
    • warning: availability does not match previous declaration
    • +
    • warning: feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version %2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; attribute ignored
    • +
    • warning: ignoring availability attribute %select{on '+load' method|with constructor attribute|with destructor attribute}0
    • +
    • warning: only 'unavailable' and 'deprecated' are supported for Swift availability
    • +
    • warning: unknown platform %0 in availability macro
    • +
    • warning: use same version number separators '_' or '.'; as in 'major[.minor[.subminor]]'
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-frame-larger-than + clang-diagnostic-frame-larger-than + + Diagnostic text:

    +
      +
    • warning: %0
    • +
    • warning: stack frame size (%0) exceeds limit (%1) in '%2'
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-inline-asm + clang-diagnostic-inline-asm + + Diagnostic text:

    +
      +
    • warning: %0
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-pass-failed + clang-diagnostic-pass-failed + + Diagnostic text:

    +
      +
    • warning: %0
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-pass + clang-diagnostic-pass + + Diagnostic text:

    +
      +
    • remark: %0
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-pass-analysis + clang-diagnostic-pass-analysis + + Diagnostic text:

    +
      +
    • remark: %0
    • +
    • remark: %0; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop or by providing the compiler option '-ffast-math'.
    • +
    • remark: %0; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop. If the arrays will always be independent specify '#pragma clang loop vectorize(assume_safety)' before the loop or provide the '__restrict__' qualifier with the independent array arguments. Erroneous results will occur if these options are incorrectly applied!
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-pass-missed + clang-diagnostic-pass-missed + + Diagnostic text:

    +
      +
    • remark: %0
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-backend-plugin + clang-diagnostic-backend-plugin + + Diagnostic text:

    +
      +
    • warning: %0
    • +
    • warning: %0 (%1) exceeds limit (%2) in '%3'
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-source-mgr + clang-diagnostic-source-mgr + + Diagnostic text:

    +
      +
    • warning: %0
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-attribute-warning + clang-diagnostic-attribute-warning + + Diagnostic text:

    +
      +
    • warning: call to '%0' declared with 'warning' attribute: %1
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bad-function-cast + clang-diagnostic-bad-function-cast + + Diagnostic text:

    +
      +
    • warning: cast from function call of type %0 to non-matching type %1
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-binary-literal + clang-diagnostic-binary-literal + + Diagnostic text:

    +
      +
    • warning: binary integer literals are a C++14 extension
    • +
    • warning: binary integer literals are a GNU extension
    • +
    • warning: binary integer literals are incompatible with C++ standards before C++14
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bind-to-temporary-copy + clang-diagnostic-bind-to-temporary-copy + + Diagnostic text:

    +
      +
    • warning: %sub{select_initialized_entity_kind}1 of type %2 when binding a reference to a temporary would %select{invoke an inaccessible constructor|find no viable constructor|find ambiguous constructors|invoke a deleted constructor}0 in C++98
    • +
    • warning: C++98 requires an accessible copy constructor for class %2 when binding a reference to a temporary; was %select{private|protected}0
    • +
    • warning: no viable constructor %sub{select_initialized_entity_kind}0 of type %1; C++98 requires a copy constructor when binding a reference to a temporary
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bitfield-constant-conversion + clang-diagnostic-bitfield-constant-conversion + + Diagnostic text:

    +
      +
    • warning: implicit truncation from %2 to a one-bit wide bit-field changes value from %0 to %1
    • +
    • warning: implicit truncation from %2 to bit-field changes value from %0 to %1
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bitfield-enum-conversion + clang-diagnostic-bitfield-enum-conversion + + Diagnostic text:

    +
      +
    • warning: assigning value of signed enum type %1 to unsigned bit-field %0; negative enumerators of enum %1 will be converted to positive values
    • +
    • warning: bit-field %0 is not wide enough to store all enumerators of %1
    • +
    • warning: signed bit-field %0 needs an extra bit to represent the largest positive enumerators of %1
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bitfield-width + clang-diagnostic-bitfield-width + + Diagnostic text:

    +
      +
    • warning: width of bit-field %0 (%1 bits) exceeds the width of its type; value will be truncated to %2 bit%s2
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bitwise-conditional-parentheses + clang-diagnostic-bitwise-conditional-parentheses + + Diagnostic text:

    +
      +
    • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bitwise-instead-of-logical + clang-diagnostic-bitwise-instead-of-logical + + Diagnostic text:

    +
      +
    • warning: use of bitwise '%0' with boolean operands
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bitwise-op-parentheses + clang-diagnostic-bitwise-op-parentheses + + Diagnostic text:

    +
      +
    • warning: '%0' within '%1'
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-block-capture-autoreleasing + clang-diagnostic-block-capture-autoreleasing + + Diagnostic text:

    +
      +
    • warning: block captures an autoreleasing out-parameter, which may result in use-after-free bugs
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bool-conversion + clang-diagnostic-bool-conversion + + Diagnostic text:

    +
      +
    • warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    • warning: address of%select{| function| array}0 '%1' will always evaluate to 'true'
    • +
    • warning: initialization of pointer of type %0 to null from a constant boolean expression
    • +
    • warning: nonnull %select{function call|parameter}0 '%1' will evaluate to 'true' on first encounter
    • +
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-bool-operation + clang-diagnostic-bool-operation + + Diagnostic text:

    +
      +
    • warning: bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 did you mean logical negation?
    • +
    • warning: use of bitwise '%0' with boolean operands
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-branch-protection + clang-diagnostic-branch-protection + + Diagnostic text:

    +
      +
    • warning: '-mbranch-protection=' option is incompatible with the '%0' architecture
    • +
    • warning: ignoring the 'branch-protection' attribute because the '%0' architecture does not support it
    • +
    • warning: invalid branch protection option '%0' in '%1'
    • +
    • warning: unsupported branch protection specification '%0'
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-builtin-macro-redefined + clang-diagnostic-builtin-macro-redefined + + Diagnostic text:

    +
      +
    • warning: redefining builtin macro
    • +
    • warning: undefining builtin macro
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-builtin-requires-header + clang-diagnostic-builtin-requires-header + + Diagnostic text:

    +
      +
    • warning: declaration of built-in function '%1' requires inclusion of the header <%0>
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-c11-extensions + clang-diagnostic-c11-extensions + + Diagnostic text:

    +
      +
    • warning: '%0' is a C11 extension
    • +
    • warning: anonymous structs are a C11 extension
    • +
    • warning: anonymous unions are a C11 extension
    • +
    • warning: pointer comparisons before C11 need to be between two complete or two incomplete types; %0 is %select{|in}2complete and %1 is %select{|in}3complete
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-c23-extensions + clang-diagnostic-c23-extensions + + Diagnostic text:

    +
      +
    • warning: '_BitInt' suffix for literals is a C23 extension
    • +
    • warning: '_Static_assert' with no message is a C23 extension
    • +
    • warning: 'nullptr' is a C23 extension
    • +
    • warning: [[]] attributes are a C23 extension
    • +
    • warning: label at end of compound statement is a C23 extension
    • +
    • warning: label followed by a declaration is a C23 extension
    • +
    • warning: omitting the parameter name in a function definition is a C23 extension
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is a C23 extension
    • +
    • warning: use of an empty initializer is a C23 extension
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-c23-compat + clang-diagnostic-c23-compat + + Diagnostic text:

    +
      +
    • warning: '%0' is a keyword in C23
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-c99-extensions + clang-diagnostic-c99-extensions + + Diagnostic text:

    +
      +
    • warning: %select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 feature
    • +
    • warning: '%0' is a C99 extension
    • +
    • warning: ISO C99 requires whitespace after the macro name
    • +
    • warning: array designators are a C99 extension
    • +
    • warning: brace elision for designated initializer is a C99 extension
    • +
    • warning: commas at the end of enumerator lists are a C99-specific feature
    • +
    • warning: compound literals are a C99-specific feature
    • +
    • warning: designated initializers are a C++20 extension
    • +
    • warning: designated initializers are a C99 feature
    • +
    • warning: empty macro arguments are a C99 feature
    • +
    • warning: flexible array members are a C99 feature
    • +
    • warning: hexadecimal floating constants are a C99 feature
    • +
    • warning: initializer for aggregate is not a compile-time constant
    • +
    • warning: mixture of designated and non-designated initializers in the same initializer list is a C99 extension
    • +
    • warning: nested designators are a C99 extension
    • +
    • warning: variable declaration in for loop is a C99-specific feature
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - objc-nsdate-formatter - objc-nsdate-formatter + clang-diagnostic-c99-compat + clang-diagnostic-c99-compat - -

    clang-tidy - objc-nsdate-formatter

    - -

    objc-nsdate-formatter

    -

    When NSDateFormatter is used to convert an NSDate type to a String type, the user can specify a custom format string. Certain format specifiers are undesirable despite being legal. See http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns for all legal date patterns.

    -

    This checker reports as warnings the following string patterns in a date format specifier:

    -
      -
    1. yyyy + ww : Calendar year specified with week of a week year (unless YYYY is also specified). -
        -
      • Example 1: Input Date: 29 December 2014 ; Format String: yyyy-ww;
        -Output string: 2014-01 (Wrong because it's not the first week of 2014)
      • -
      • Example 2: Input Date: 29 December 2014 ; Format String: dd-MM-yyyy (ww-YYYY);
        -Output string: 29-12-2014 (01-2015) (This is correct)
      • -
    2. -
    3. F without ee/EE : Numeric day of week in a month without actual day. + Diagnostic text:

        -
      • Example: Input Date: 29 December 2014 ; Format String: F-MM;
        -Output string: 5-12 (Wrong because it reads as 5th ___ of Dec in English)
      • -
    4. -
    5. F without MM : Numeric day of week in a month without month. +
    6. warning: %select{using this character in an identifier|starting an identifier with this character}0 is incompatible with C99
    7. +
    8. warning: '%0' is a keyword in C99
    9. +
    10. warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C89; this literal will %select{have type 'long long'|be ill-formed}0 in C99 onwards
    11. +
    12. warning: unicode literals are incompatible with C99
    13. + +

      References

      +

      Diagnostic flags in Clang

      ]]> + + INFO + + + clang-diagnostic-c99-designator + clang-diagnostic-c99-designator + + Diagnostic text:

        -
      • Example: Input Date: 29 December 2014 ; Format String: F-EE
        -Output string: 5-Mon (Wrong because it reads as 5th Mon of ___ in English)
      • -
      -
    14. WW without MM : Week of the month without the month. +
    15. warning: array designators are a C99 extension
    16. +
    17. warning: brace elision for designated initializer is a C99 extension
    18. +
    19. warning: designated initializers are a C++20 extension
    20. +
    21. warning: designated initializers are a C99 feature
    22. +
    23. warning: mixture of designated and non-designated initializers in the same initializer list is a C99 extension
    24. +
    25. warning: nested designators are a C99 extension
    26. + +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      + + clang-diagnostic-pre-c23-compat + clang-diagnostic-pre-c23-compat + + Diagnostic text:

        -
      • Example: Input Date: 29 December 2014 ; Format String: WW-yyyy
        -Output string: 05-2014 (Wrong because it reads as 5th Week of ___ in English)
      • -
      -
    27. YYYY + QQ : Week year specified with quarter of normal year (unless yyyy is also specified). +
    28. warning: #warning is incompatible with C standards before C23
    29. +
    30. warning: '%0' is incompatible with C standards before C23
    31. +
    32. warning: '...' as the only parameter of a function is incompatible with C standards before C23
    33. +
    34. warning: '_BitInt' suffix for literals is incompatible with C standards before C23
    35. +
    36. warning: '_Static_assert' with no message is incompatible with C standards before C23
    37. +
    38. warning: [[]] attributes are incompatible with C standards before C23
    39. +
    40. warning: digit separators are incompatible with C standards before C23
    41. +
    42. warning: label at end of compound statement is incompatible with C standards before C23
    43. +
    44. warning: label followed by a declaration is incompatible with C standards before C23
    45. +
    46. warning: specifying character '%0' with a universal character name is incompatible with C standards before C23
    47. +
    48. warning: universal character name referring to a control character is incompatible with C standards before C23
    49. +
    50. warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C standards before C23
    51. +
    52. warning: use of an empty initializer is incompatible with C standards before C23
    53. + +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      + + clang-diagnostic-pre-c23-compat-pedantic + clang-diagnostic-pre-c23-compat-pedantic + + Diagnostic text:

        -
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-QQ
        -Output string: 2015-04 (Wrong because it's not the 4th quarter of 2015)
      • -
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (QQ-yyyy)
        -Output string: 01-2015 (04-2014) (This is correct)
      • -
      -
    54. YYYY + MM : Week year specified with Month of a calendar year (unless yyyy is also specified). +
    55. warning: #warning is incompatible with C standards before C23
    56. +
    57. warning: '%0' is incompatible with C standards before C23
    58. +
    59. warning: '...' as the only parameter of a function is incompatible with C standards before C23
    60. +
    61. warning: '_BitInt' suffix for literals is incompatible with C standards before C23
    62. +
    63. warning: '_Static_assert' with no message is incompatible with C standards before C23
    64. +
    65. warning: [[]] attributes are incompatible with C standards before C23
    66. +
    67. warning: digit separators are incompatible with C standards before C23
    68. +
    69. warning: label at end of compound statement is incompatible with C standards before C23
    70. +
    71. warning: label followed by a declaration is incompatible with C standards before C23
    72. +
    73. warning: specifying character '%0' with a universal character name is incompatible with C standards before C23
    74. +
    75. warning: universal character name referring to a control character is incompatible with C standards before C23
    76. +
    77. warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C standards before C23
    78. +
    79. warning: use of an empty initializer is incompatible with C standards before C23
    80. + +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      + + clang-diagnostic-ctad-maybe-unsupported + clang-diagnostic-ctad-maybe-unsupported + + Diagnostic text:

        -
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-MM
        -Output string: 2015-12 (Wrong because it's not the 12th month of 2015)
      • -
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (MM-yyyy)
        -Output string: 01-2015 (12-2014) (This is correct)
      • -
      -
    81. YYYY + DD : Week year with day of a calendar year (unless yyyy is also specified). +
    82. warning: %0 may not intend to support class template argument deduction
    83. + +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      + + clang-diagnostic-c++11-extensions + clang-diagnostic-c++11-extensions + + Diagnostic text:

        -
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-DD
        -Output string: 2015-363 (Wrong because it's not the 363rd day of 2015)
      • -
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (DD-yyyy)
        -Output string: 01-2015 (363-2014) (This is correct)
      • -
      -
    84. YYYY + WW : Week year with week of a calendar year (unless yyyy is also specified). +
    85. warning: %select{defaulted|deleted}0 function definitions are a C++11 extension
    86. +
    87. warning: '%0' keyword is a C++11 extension
    88. +
    89. warning: 'auto' type specifier is a C++11 extension
    90. +
    91. warning: 'long long' is a C++11 extension
    92. +
    93. warning: 'template' keyword outside of a template
    94. +
    95. warning: 'typename' occurs outside of a template
    96. +
    97. warning: [[]] attributes are a C++11 extension
    98. +
    99. warning: alias declarations are a C++11 extension
    100. +
    101. warning: befriending enumeration type %0 is a C++11 extension
    102. +
    103. warning: commas at the end of enumerator lists are a C++11 extension
    104. +
    105. warning: default member initializer for non-static data member is a C++11 extension
    106. +
    107. warning: default template arguments for a function template are a C++11 extension
    108. +
    109. warning: enumeration types with a fixed underlying type are a C++11 extension
    110. +
    111. warning: explicit conversion functions are a C++11 extension
    112. +
    113. warning: extern templates are a C++11 extension
    114. +
    115. warning: extra ';' outside of a function is a C++11 extension
    116. +
    117. warning: generalized initializer lists are a C++11 extension
    118. +
    119. warning: implicit conversion from array size expression of type %0 to %select{integral|enumeration}1 type %2 is a C++11 extension
    120. +
    121. warning: inline namespaces are a C++11 feature
    122. +
    123. warning: non-class friend type %0 is a C++11 extension
    124. +
    125. warning: non-type template argument referring to %select{function|object}0 %1 with internal linkage is a C++11 extension
    126. +
    127. warning: range-based for loop is a C++11 extension
    128. +
    129. warning: reference qualifiers on functions are a C++11 extension
    130. +
    131. warning: rvalue references are a C++11 extension
    132. +
    133. warning: scoped enumerations are a C++11 extension
    134. +
    135. warning: static data member %0 in union is a C++11 extension
    136. +
    137. warning: unelaborated friend declaration is a C++11 extension; specify '%select{struct|interface|union|class|enum}0' to befriend %1
    138. +
    139. warning: use of enumeration in a nested name specifier is a C++11 extension
    140. +
    141. warning: variadic templates are a C++11 extension
    142. + +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      + + clang-diagnostic-c++11-compat + clang-diagnostic-c++11-compat + + Diagnostic text:

        -
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-WW
        -Output string: 2015-05 (Wrong because it's not the 5th week of 2015)
      • -
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (WW-MM-yyyy)
        -Output string: 01-2015 (05-12-2014) (This is correct)
      • -
      -
    143. YYYY + F : Week year with day of week in a calendar month (unless yyyy is also specified). +
    144. warning: #warning is incompatible with C++ standards before C++23
    145. +
    146. warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    147. +
    148. warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    149. +
    150. warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    151. +
    152. warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    153. +
    154. warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    155. +
    156. warning: '%0' is a keyword in C++11
    157. +
    158. warning: '<=>' operator is incompatible with C++ standards before C++20
    159. +
    160. warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    161. +
    162. warning: 'auto' storage class specifier is redundant and incompatible with C++11
    163. +
    164. warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    165. +
    166. warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    167. +
    168. warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    169. +
    170. warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    171. +
    172. warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    173. +
    174. warning: alias declaration in this context is incompatible with C++ standards before C++23
    175. +
    176. warning: by value capture of '*this' is incompatible with C++ standards before C++17
    177. +
    178. warning: captured structured bindings are incompatible with C++ standards before C++20
    179. +
    180. warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    181. +
    182. warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    183. +
    184. warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    185. +
    186. warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    187. +
    188. warning: consteval if is incompatible with C++ standards before C++23
    189. +
    190. warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    191. +
    192. warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    193. +
    194. warning: constexpr if is incompatible with C++ standards before C++17
    195. +
    196. warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    197. +
    198. warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    199. +
    200. warning: conversion from string literal to %0 is deprecated
    201. +
    202. warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    203. +
    204. warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    205. +
    206. warning: decomposition declarations are incompatible with C++ standards before C++17
    207. +
    208. warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    209. +
    210. warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    211. +
    212. warning: defaulted comparison operators are incompatible with C++ standards before C++20
    213. +
    214. warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    215. +
    216. warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    217. +
    218. warning: digit separators are incompatible with C++ standards before C++14
    219. +
    220. warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    221. +
    222. warning: explicit instantiation cannot be 'inline'
    223. +
    224. warning: explicit instantiation of %0 must occur at global scope
    225. +
    226. warning: explicit instantiation of %0 not in a namespace enclosing %1
    227. +
    228. warning: explicit instantiation of %q0 must occur in namespace %1
    229. +
    230. warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    231. +
    232. warning: explicit(bool) is incompatible with C++ standards before C++20
    233. +
    234. warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    235. +
    236. warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    237. +
    238. warning: generic lambdas are incompatible with C++11
    239. +
    240. warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    241. +
    242. warning: identifier after literal will be treated as a user-defined literal suffix in C++11
    243. +
    244. warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    245. +
    246. warning: initialized lambda captures are incompatible with C++ standards before C++14
    247. +
    248. warning: inline nested namespace definition is incompatible with C++ standards before C++20
    249. +
    250. warning: inline variables are incompatible with C++ standards before C++17
    251. +
    252. warning: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    253. +
    254. warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C++98; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    255. +
    256. warning: label at end of compound statement is incompatible with C++ standards before C++23
    257. +
    258. warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    259. +
    260. warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    261. +
    262. warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    263. +
    264. warning: nested namespace definition is incompatible with C++ standards before C++17
    265. +
    266. warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    267. +
    268. warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    269. +
    270. warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    271. +
    272. warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    273. +
    274. warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    275. +
    276. warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    277. +
    278. warning: pack expansion using declaration is incompatible with C++ standards before C++17
    279. +
    280. warning: pack fold expression is incompatible with C++ standards before C++17
    281. +
    282. warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    283. +
    284. warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    285. +
    286. warning: return type deduction is incompatible with C++ standards before C++14
    287. +
    288. warning: static lambdas are incompatible with C++ standards before C++23
    289. +
    290. warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    291. +
    292. warning: type %0 cannot be narrowed to %1 in initializer list
    293. +
    294. warning: type %0 cannot be narrowed to %1 in initializer list
    295. +
    296. warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    297. +
    298. warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    299. +
    300. warning: unicode literals are incompatible with C++ standards before C++17
    301. +
    302. warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    303. +
    304. warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    305. +
    306. warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    307. +
    308. warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    309. +
    310. warning: use of right-shift operator ('>>') in template argument will require parentheses in C++11
    311. +
    312. warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    313. +
    314. warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    315. +
    316. warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    317. +
    318. warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    319. +
    320. warning: using enum declaration is incompatible with C++ standards before C++20
    321. +
    322. warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    323. +
    324. warning: variable templates are incompatible with C++ standards before C++14
    325. +
    326. warning: virtual constexpr functions are incompatible with C++ standards before C++20
    327. + +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + CRITICAL +
      + + clang-diagnostic-c++11-compat-deprecated-writable-strings + clang-diagnostic-c++11-compat-deprecated-writable-strings + + Diagnostic text:

        -
      • Example 1: Input Date: 29 December 2014 ; Format String: YYYY-ww-F-EE
        -Output string: 2015-01-5-Mon (Wrong because it's not the 5th Monday of January in 2015)
      • -
      • Example 2: Input Date: 29 December 2014 ; Format String: ww-YYYY (F-EE-MM-yyyy)
        -Output string: 01-2015 (5-Mon-12-2014) (This is correct)
      • -
      -
    +
  • warning: conversion from string literal to %0 is deprecated
  • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    INFO
    - portability-std-allocator-const - portability-std-allocator-const + clang-diagnostic-c++11-compat-pedantic + clang-diagnostic-c++11-compat-pedantic - -

    clang-tidy - portability-std-allocator-const

    - -

    portability-std-allocator-const

    -

    Report use of std::vector<const T> (and similar containers of const elements). These are not allowed in standard C++, and should usually be std::vector<T> instead."

    -

    Per C++ [allocator.requirements.general]: "T is any cv-unqualified object type", std::allocator<const T> is undefined. Many standard containers use std::allocator by default and therefore their const T instantiations are undefined.

    -

    libc++ defines std::allocator<const T> as an extension which will be removed in the future.

    -

    libstdc++ and MSVC do not support std::allocator<const T>:

    -
    // libstdc++ has a better diagnostic since https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48101
    -std::deque<const int> deque; // error: static assertion failed: std::deque must have a non-const, non-volatile value_type
    -std::set<const int> set; // error: static assertion failed: std::set must have a non-const, non-volatile value_type
    -std::vector<int* const> vector; // error: static assertion failed: std::vector must have a non-const, non-volatile value_type
    -
    -// MSVC
    -// error C2338: static_assert failed: 'The C++ Standard forbids containers of const elements because allocator<const T> is ill-formed.'
    -

    Code bases only compiled with libc++ may accrue such undefined usage. This check finds such code and prevents backsliding while clean-up is ongoing.

    + Diagnostic text:

    +
      +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: '%0' is a keyword in C++11
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' storage class specifier is redundant and incompatible with C++11
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • +
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
    • +
    • warning: binary integer literals are incompatible with C++ standards before C++14
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • +
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: conversion from string literal to %0 is deprecated
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: designated initializers are incompatible with C++ standards before C++20
    • +
    • warning: digit separators are incompatible with C++ standards before C++14
    • +
    • warning: digit separators are incompatible with C++ standards before C++14
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit instantiation cannot be 'inline'
    • +
    • warning: explicit instantiation of %0 must occur at global scope
    • +
    • warning: explicit instantiation of %0 not in a namespace enclosing %1
    • +
    • warning: explicit instantiation of %q0 must occur in namespace %1
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: generic lambdas are incompatible with C++11
    • +
    • warning: generic lambdas are incompatible with C++11
    • +
    • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
    • +
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    • +
    • warning: identifier after literal will be treated as a user-defined literal suffix in C++11
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • +
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • +
    • warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C++98; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • +
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • +
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: return type deduction is incompatible with C++ standards before C++14
    • +
    • warning: return type deduction is incompatible with C++ standards before C++14
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of right-shift operator ('>>') in template argument will require parentheses in C++11
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable templates are incompatible with C++ standards before C++14
    • +
    • warning: variable templates are incompatible with C++ standards before C++14
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +

    References

    -

    clang.llvm.org

    ]]> - +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - - - - - clang-diagnostic-aix-compat - clang-diagnostic-aix-compat + + clang-diagnostic-c++11-compat-reserved-user-defined-literal + clang-diagnostic-c++11-compat-reserved-user-defined-literal Diagnostic text:

      -
    • warning: #pragma align(packed) may not be compatible with objects generated with AIX XL C/C++
    • -
    • warning: requesting an alignment of 16 bytes or greater for struct members is not binary compatible with IBM XL C/C++ for AIX 16.1.0 and older
    • +
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-arc-non-pod-memaccess - clang-diagnostic-arc-non-pod-memaccess + clang-diagnostic-c++11-extra-semi + clang-diagnostic-c++11-extra-semi Diagnostic text:

      -
    • warning: %select{destination for|source of}0 this %1 call is a pointer to ownership-qualified type %2
    • +
    • warning: extra ';' outside of a function is a C++11 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-arc-repeated-use-of-weak - clang-diagnostic-arc-repeated-use-of-weak + clang-diagnostic-c++11-inline-namespace + clang-diagnostic-c++11-inline-namespace Diagnostic text:

      -
    • warning: weak %select{variable|property|implicit property|instance variable}0 %1 is accessed multiple times in this %select{function|method|block|lambda}2 but may be unpredictably set to nil; assign to a strong variable to keep the object alive
    • -
    • warning: weak %select{variable|property|implicit property|instance variable}0 %1 may be accessed multiple times in this %select{function|method|block|lambda}2 and may be unpredictably set to nil; assign to a strong variable to keep the object alive
    • +
    • warning: inline namespaces are a C++11 feature

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-arc-maybe-repeated-use-of-weak - clang-diagnostic-arc-maybe-repeated-use-of-weak + clang-diagnostic-c++11-long-long + clang-diagnostic-c++11-long-long Diagnostic text:

      -
    • warning: weak %select{variable|property|implicit property|instance variable}0 %1 may be accessed multiple times in this %select{function|method|block|lambda}2 and may be unpredictably set to nil; assign to a strong variable to keep the object alive
    • +
    • warning: 'long long' is a C++11 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-arc-retain-cycles - clang-diagnostic-arc-retain-cycles + clang-diagnostic-c++11-narrowing + clang-diagnostic-c++11-narrowing Diagnostic text:

      -
    • warning: capturing %0 strongly in this block is likely to lead to a retain cycle
    • +
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-arc-unsafe-retained-assign - clang-diagnostic-arc-unsafe-retained-assign + clang-diagnostic-c++11-narrowing-const-reference + clang-diagnostic-c++11-narrowing-const-reference Diagnostic text:

      -
    • warning: assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0 to a weak %select{property|variable}1; object will be released after assignment
    • -
    • warning: assigning retained object to %select{weak|unsafe_unretained}0 %select{property|variable}1; object will be released after assignment
    • -
    • warning: assigning retained object to unsafe property; object will be released after assignment
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-asm - clang-diagnostic-asm + clang-diagnostic-inconsistent-missing-destructor-override + clang-diagnostic-inconsistent-missing-destructor-override Diagnostic text:

      -
    • warning: value size does not match register size specified by the constraint and modifier
    • +
    • warning: %sub{warn_destructor_marked_not_override_overriding}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-asm-operand-widths - clang-diagnostic-asm-operand-widths + clang-diagnostic-inconsistent-missing-override + clang-diagnostic-inconsistent-missing-override Diagnostic text:

      -
    • warning: value size does not match register size specified by the constraint and modifier
    • +
    • warning: %sub{warn_function_marked_not_override_overriding}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-avr-rtlib-linking-quirks - clang-diagnostic-avr-rtlib-linking-quirks + clang-diagnostic-suggest-override + clang-diagnostic-suggest-override Diagnostic text:

      -
    • warning: no avr-gcc installation can be found on the system, cannot link standard libraries
    • -
    • warning: no avr-libc installation can be found on the system, cannot link standard libraries
    • -
    • warning: no target microcontroller specified on command line, cannot link standard libraries, please pass -mmcu=<mcu name>
    • -
    • warning: standard library not linked and so no interrupt vector table or compiler runtime routines will be linked
    • -
    • warning: support for linking stdlibs for microcontroller '%0' is not implemented
    • -
    • warning: support for passing the data section address to the linker for microcontroller '%0' is not implemented
    • +
    • warning: %sub{warn_function_marked_not_override_overriding}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-absolute-value - clang-diagnostic-absolute-value + clang-diagnostic-suggest-destructor-override + clang-diagnostic-suggest-destructor-override Diagnostic text:

      -
    • warning: absolute value function %0 given an argument of type %1 but has parameter of type %2 which may cause truncation of value
    • -
    • warning: taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious
    • -
    • warning: taking the absolute value of unsigned type %0 has no effect
    • -
    • warning: using %select{integer|floating point|complex}1 absolute value function %0 when argument is of %select{integer|floating point|complex}2 type
    • +
    • warning: %sub{warn_destructor_marked_not_override_overriding}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-abstract-final-class - clang-diagnostic-abstract-final-class + clang-diagnostic-c++14-extensions + clang-diagnostic-c++14-extensions Diagnostic text:

      -
    • warning: abstract class is marked '%select{final|sealed}0'
    • +
    • warning: 'decltype(auto)' type specifier is a C++14 extension
    • +
    • warning: binary integer literals are a C++14 extension
    • +
    • warning: initialized lambda captures are a C++14 extension
    • +
    • warning: multiple return statements in constexpr function is a C++14 extension
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is a C++14 extension
    • +
    • warning: use of the %0 attribute is a C++14 extension
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++14 extension
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is a C++14 extension
    • +
    • warning: variable templates are a C++14 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-address-of-temporary - clang-diagnostic-address-of-temporary + clang-diagnostic-c++14-attribute-extensions + clang-diagnostic-c++14-attribute-extensions Diagnostic text:

      -
    • warning: taking the address of a temporary object of type %0
    • +
    • warning: use of the %0 attribute is a C++14 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-all - clang-diagnostic-all + clang-diagnostic-c++14-binary-literal + clang-diagnostic-c++14-binary-literal Diagnostic text:

      -
    • warning: #pragma execution_character_set expected '%0'
    • -
    • warning: #pragma execution_character_set expected 'push' or 'pop'
    • -
    • warning: #pragma execution_character_set invalid value '%0', only 'UTF-8' is supported
    • -
    • warning: #pragma warning expected '%0'
    • -
    • warning: #pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4
    • -
    • warning: #pragma warning expected a warning number
    • -
    • warning: #pragma warning(push, level) requires a level between 0 and 4
    • -
    • warning: %0
    • -
    • warning: %0 has C-linkage specified, but returns incomplete type %1 which could be incompatible with C
    • -
    • warning: %0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C
    • -
    • warning: %0 has lower precedence than %1; %1 will be evaluated first
    • -
    • warning: %2 defined as %select{a struct|an interface|a class}0%select{| template}1 here but previously declared as %select{a struct|an interface|a class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • -
    • warning: %plural{1:enumeration value %1 not handled in switch|2:enumeration values %1 and %2 not handled in switch|3:enumeration values %1, %2, and %3 not handled in switch|:%0 enumeration values not handled in switch: %1, %2, %3...}0
    • -
    • warning: %q0 hides overloaded virtual %select{function|functions}1
    • -
    • warning: %select{aligning a value|the result of checking whether a value is aligned}0 to 1 byte is %select{a no-op|always true}0
    • -
    • warning: %select{delete|destructor}0 called on %1 that is abstract but has non-virtual destructor
    • -
    • warning: %select{delete|destructor}0 called on non-final %1 that has virtual functions but non-virtual destructor
    • -
    • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
    • -
    • warning: %select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior
    • -
    • warning: %select{field|base class}0 %1 will be initialized after %select{field|base}2 %3
    • -
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • -
    • warning: %select{self-|array }0comparison always evaluates to %select{a constant|true|false|'std::strong_ordering::equal'}1
    • -
    • warning: %select{struct|interface|class}0%select{| template}1 %2 was previously declared as a %select{struct|interface|class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • -
    • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
    • -
    • warning: %select{void function|void method|constructor|destructor}1 %0 should not return a value
    • -
    • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++
    • -
    • warning: '%%n' specifier not supported on this platform
    • -
    • warning: '%0' is not a valid object format flag
    • -
    • warning: '%0' within '%1'
    • -
    • warning: '%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument
    • -
    • warning: '&&' within '||'
    • -
    • warning: '/*' within block comment
    • -
    • warning: 'static' function %0 declared in header file should be declared 'static inline'
    • -
    • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • -
    • warning: // comments are not allowed in this language
    • -
    • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0
    • -
    • warning: add explicit braces to avoid dangling else
    • -
    • warning: adding %0 to a string does not append to the string
    • -
    • warning: all paths through this function will call itself
    • -
    • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
    • -
    • warning: array section %select{lower bound|length}0 is of type 'char'
    • -
    • warning: array subscript is of type 'char'
    • -
    • warning: assigning %select{field|instance variable}0 to itself
    • -
    • warning: base class %0 is uninitialized when used here to access %q1
    • -
    • warning: bitwise comparison always evaluates to %select{false|true}0
    • -
    • warning: bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 did you mean logical negation?
    • -
    • warning: bitwise or with non-zero value always evaluates to true
    • -
    • warning: block pointer variable %0 is %select{uninitialized|null}1 when captured by block
    • -
    • warning: calling '%0' with a nonzero argument is unsafe
    • -
    • warning: cannot mix positional and non-positional arguments in format string
    • -
    • warning: case value not in enumerated type %0
    • -
    • warning: cast of type %0 to %1 is deprecated; use sel_getName instead
    • -
    • warning: comparison of %select{address of|function|array}0 '%1' %select{not |}2equal to a null pointer is always %select{true|false}2
    • -
    • warning: comparison of nonnull %select{function call|parameter}0 '%1' %select{not |}2equal to a null pointer is '%select{true|false}2' on first encounter
    • -
    • warning: container access result unused - container access should not be used for side effects
    • -
    • warning: convenience initializer missing a 'self' call to another initializer
    • -
    • warning: convenience initializer should not invoke an initializer on 'super'
    • -
    • warning: converting the enum constant to a boolean
    • -
    • warning: converting the result of '<<' to a boolean always evaluates to %select{false|true}0
    • -
    • warning: converting the result of '<<' to a boolean; did you mean '(%0) != 0'?
    • -
    • warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true'
    • -
    • warning: data argument not used by format string
    • -
    • warning: data argument position '%0' exceeds the number of data arguments (%1)
    • -
    • warning: designated initializer invoked a non-designated initializer
    • -
    • warning: designated initializer missing a 'super' call to a designated initializer of the super class
    • -
    • warning: designated initializer should only invoke a designated initializer on 'super'
    • -
    • warning: double-quoted include "%0" cannot be aliased to angle-bracketed include <%1>
    • -
    • warning: equality comparison with extraneous parentheses
    • -
    • warning: escaped newline between */ characters at block comment end
    • -
    • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
    • -
    • warning: expected end of directive in pragma
    • -
    • warning: explicitly assigning value of variable of type %0 to itself
    • -
    • warning: explicitly assigning value of variable of type %0 to itself
    • -
    • warning: explicitly moving variable of type %0 to itself
    • -
    • warning: explicitly moving variable of type %0 to itself
    • -
    • warning: expression result unused
    • -
    • warning: expression result unused; should this cast be to 'void'?
    • -
    • warning: expression with side effects has no effect in an unevaluated context
    • -
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
    • -
    • warning: field %0 can overwrite instance variable %1 with variable sized type %2 in superclass %3
    • -
    • warning: field %0 is uninitialized when used here
    • -
    • warning: field %0 with variable sized type %1 is not visible to subclasses and can conflict with their instance variables
    • -
    • warning: field %select{width|precision}0 should have type %1, but argument has type %2
    • -
    • warning: flag '%0' is ignored when flag '%1' is present
    • -
    • warning: flag '%0' results in undefined behavior with '%1' conversion specifier
    • -
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1
    • -
    • warning: format string contains '\0' within the string body
    • -
    • warning: format string is empty
    • -
    • warning: format string is not a string literal (potentially insecure)
    • -
    • warning: format string is not null-terminated
    • -
    • warning: format string missing
    • -
    • warning: format string should not be a wide string
    • -
    • warning: ignored trigraph would end block comment
    • -
    • warning: ignoring return value of function declared with %0 attribute
    • -
    • warning: ignoring return value of function declared with %0 attribute
    • -
    • warning: ignoring return value of function declared with %0 attribute: %1
    • -
    • warning: ignoring temporary created by a constructor declared with %0 attribute
    • -
    • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
    • -
    • warning: implicit declaration of function %0
    • -
    • warning: implicit declaration of function %0 is invalid in C99
    • -
    • warning: implicitly declaring library function '%0' with type %1
    • -
    • warning: incomplete format specifier
    • -
    • warning: initializer order does not match the declaration order
    • -
    • warning: invalid conversion specifier '%0'
    • -
    • warning: invalid position specified for %select{field width|field precision}0
    • -
    • warning: ivar %0 which backs the property is not referenced in this property's accessor
    • -
    • warning: lambda capture %0 is not %select{used|required to be captured for this use}1
    • -
    • warning: left operand of comma operator has no effect
    • -
    • warning: length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier
    • -
    • warning: logical not is only applied to the left hand side of this %select{comparison|bitwise operator}0
    • -
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • -
    • warning: loop variable %0 creates a copy from type %1
    • -
    • warning: method override for the designated initializer of the superclass %objcinstance0 not found
    • -
    • warning: method possibly missing a [super %0] call
    • -
    • warning: misleading indentation; statement is not part of the previous '%select{if|else|for|while}0'
    • -
    • warning: missing object format flag
    • -
    • warning: more '%%' conversions than data arguments
    • -
    • warning: moving a local object in a return statement prevents copy elision
    • -
    • warning: moving a temporary object prevents copy elision
    • -
    • warning: multi-character character constant
    • -
    • warning: multi-line // comment
    • -
    • warning: no closing ']' for '%%[' in scanf format string
    • -
    • warning: non-void %select{function|method}1 %0 should return a value
    • -
    • warning: non-void %select{function|method}1 %0 should return a value
    • -
    • warning: non-void coroutine does not return a value
    • -
    • warning: non-void coroutine does not return a value in all control paths
    • -
    • warning: non-void function does not return a value
    • -
    • warning: non-void function does not return a value in all control paths
    • -
    • warning: non-void lambda does not return a value
    • -
    • warning: non-void lambda does not return a value in all control paths
    • -
    • warning: null passed to a callee that requires a non-null argument
    • -
    • warning: null returned from %select{function|method}0 that requires a non-null return value
    • -
    • warning: object format flags cannot be used with '%0' conversion specifier
    • -
    • warning: operator '%0' has lower precedence than '%1'; '%1' will be evaluated first
    • -
    • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
    • -
    • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
    • -
    • warning: overflow converting case value to switch condition type (%0 to %1)
    • -
    • warning: overlapping comparisons always evaluate to %select{false|true}0
    • -
    • warning: overloaded operator %select{>>|<<}0 has higher precedence than comparison operator
    • -
    • warning: position arguments in format strings start counting at 1 (not 0)
    • -
    • warning: pragma STDC FENV_ROUND is not supported
    • -
    • warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'
    • -
    • warning: pragma diagnostic expected option name (e.g. "-Wundef")
    • -
    • warning: pragma diagnostic pop could not pop, no matching push
    • -
    • warning: pragma include_alias expected '%0'
    • -
    • warning: pragma include_alias expected include filename
    • -
    • warning: private field %0 is not used
    • -
    • warning: redundant move in return statement
    • -
    • warning: reference %0 is not yet bound to a value when used here
    • -
    • warning: reference %0 is not yet bound to a value when used within its own initialization
    • -
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • -
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO
    • -
    • warning: sizeof on array function parameter will return size of %0 instead of %1
    • -
    • warning: sizeof on pointer operation will return size of %0 instead of %1
    • -
    • warning: static variable %0 is suspiciously used within its own initialization
    • -
    • warning: suggest braces around initialization of subobject
    • -
    • warning: switch condition has boolean value
    • -
    • warning: trigraph converted to '%0' character
    • -
    • warning: trigraph ends block comment
    • -
    • warning: trigraph ignored
    • -
    • warning: type specifier missing, defaults to 'int'
    • -
    • warning: unexpected token in pragma diagnostic
    • -
    • warning: unknown pragma ignored
    • -
    • warning: unknown pragma in STDC namespace
    • -
    • warning: unused %select{typedef|type alias}0 %1
    • -
    • warning: unused function %0
    • -
    • warning: unused label %0
    • -
    • warning: unused variable %0
    • -
    • warning: unused variable %0
    • -
    • warning: use of __private_extern__ on a declaration may not produce external symbol private to the linkage unit and is deprecated
    • -
    • warning: use of bitwise '%0' with boolean operands
    • -
    • warning: use of unknown builtin %0
    • -
    • warning: using '%%P' format specifier without precision
    • -
    • warning: using '%0' format specifier annotation outside of os_log()/os_trace()
    • -
    • warning: using '%0' format specifier, but argument has boolean value
    • -
    • warning: using the result of an assignment as a condition without parentheses
    • -
    • warning: variable %0 is %select{decremented|incremented}1 both in the loop header and in the loop body
    • -
    • warning: variable %0 is %select{used|captured}1 uninitialized whenever %select{'%3' condition is %select{true|false}4|'%3' loop %select{is entered|exits because its condition is false}4|'%3' loop %select{condition is true|exits because its condition is false}4|switch %3 is taken|its declaration is reached|%3 is called}2
    • -
    • warning: variable %0 is uninitialized when %select{used here|captured by block}1
    • -
    • warning: variable %0 is uninitialized when passed as a const reference argument here
    • -
    • warning: variable %0 is uninitialized when used within its own initialization
    • -
    • warning: variable %0 set but not used
    • -
    • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body
    • -
    • warning: zero field width in scanf format string is unused
    • +
    • warning: binary integer literals are a C++14 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-always-inline-coroutine - clang-diagnostic-always-inline-coroutine + clang-diagnostic-c++14-compat + clang-diagnostic-c++14-compat Diagnostic text:

      -
    • warning: this coroutine may be split into pieces; not every piece is guaranteed to be inlined
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ambiguous-member-template - clang-diagnostic-ambiguous-member-template + clang-diagnostic-c++14-compat-pedantic + clang-diagnostic-c++14-compat-pedantic Diagnostic text:

      -
    • warning: lookup of %0 in member access expression is ambiguous; using member of %1
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: designated initializers are incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ambiguous-macro - clang-diagnostic-ambiguous-macro + clang-diagnostic-c++17-extensions + clang-diagnostic-c++17-extensions Diagnostic text:

      -
    • warning: ambiguous expansion of macro %0
    • +
    • warning: '%select{if|switch}0' initialization statements are a C++17 extension
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is a C++17 extension
    • +
    • warning: 'constexpr' on lambda expressions is a C++17 extension
    • +
    • warning: 'static_assert' with no message is a C++17 extension
    • +
    • warning: ISO C++ standards before C++17 do not allow new expression for type %0 to use list-initialization
    • +
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are a C++17 extension
    • +
    • warning: capture of '*this' by copy is a C++17 extension
    • +
    • warning: constexpr if is a C++17 extension
    • +
    • warning: decomposition declarations are a C++17 extension
    • +
    • warning: default scope specifier for attributes is a C++17 extension
    • +
    • warning: hexadecimal floating literals are a C++17 feature
    • +
    • warning: inline variables are a C++17 extension
    • +
    • warning: nested namespace definition is a C++17 extension; define each namespace separately
    • +
    • warning: pack expansion of using declaration is a C++17 extension
    • +
    • warning: pack fold expression is a C++17 extension
    • +
    • warning: template template parameter using 'typename' is a C++17 extension
    • +
    • warning: use of multiple declarators in a single using declaration is a C++17 extension
    • +
    • warning: use of the %0 attribute is a C++17 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-anon-enum-enum-conversion - clang-diagnostic-anon-enum-enum-conversion + clang-diagnostic-c++17-attribute-extensions + clang-diagnostic-c++17-attribute-extensions Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: use of the %0 attribute is a C++17 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-array-bounds - clang-diagnostic-array-bounds + clang-diagnostic-c++17-compat + clang-diagnostic-c++17-compat Diagnostic text:

      -
    • warning: array argument is too small; %select{contains %0 elements|is of size %0}2, callee requires at least %1
    • -
    • warning: array index %0 is before the beginning of the array
    • -
    • warning: array index %0 is past the end of the array (which contains %1 element%s2)
    • -
    • warning: array index %0 refers past the last possible element for an array in %1-bit address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)
    • -
    • warning: the pointer incremented by %0 refers past the last possible element for an array in %1-bit address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-array-bounds-pointer-arithmetic - clang-diagnostic-array-bounds-pointer-arithmetic + clang-diagnostic-c++17-compat-mangling + clang-diagnostic-c++17-compat-mangling Diagnostic text:

      -
    • warning: the pointer decremented by %0 refers before the beginning of the array
    • -
    • warning: the pointer incremented by %0 refers past the end of the array (that contains %1 element%s2)
    • +
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-atomic-alignment - clang-diagnostic-atomic-alignment + clang-diagnostic-c++17-compat-pedantic + clang-diagnostic-c++17-compat-pedantic Diagnostic text:

      -
    • warning: large atomic operation may incur significant performance penalty; the access size (%0 bytes) exceeds the max lock-free size (%1 bytes)
    • -
    • warning: misaligned atomic operation may incur significant performance penalty; the expected alignment (%0 bytes) exceeds the actual alignment (%1 bytes)
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: designated initializers are incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-atomic-properties - clang-diagnostic-atomic-properties + clang-diagnostic-c++20-extensions + clang-diagnostic-c++20-extensions Diagnostic text:

      -
    • warning: atomic by default property %0 has a user defined %select{getter|setter}1 (property should be marked 'atomic' if this is intended)
    • -
    • warning: property is assumed atomic by default
    • -
    • warning: property is assumed atomic when auto-synthesizing the property
    • +
    • warning: aggregate initialization of type %0 from a parenthesized list of values is a C++20 extension
    • +
    • warning: captured structured bindings are a C++20 extension
    • +
    • warning: constexpr constructor that does not initialize all members is a C++20 extension
    • +
    • warning: constexpr union constructor that does not initialize any member is a C++20 extension
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension
    • +
    • warning: default member initializer for bit-field is a C++20 extension
    • +
    • warning: defaulted comparison operators are a C++20 extension
    • +
    • warning: designated initializers are a C++20 extension
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is a C++20 extension
    • +
    • warning: explicit template parameter list for lambdas is a C++20 extension
    • +
    • warning: explicit(bool) is a C++20 extension
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is a C++20 extension
    • +
    • warning: initialized lambda pack captures are a C++20 extension
    • +
    • warning: inline nested namespace definition is a C++20 extension
    • +
    • warning: invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension
    • +
    • warning: missing 'typename' prior to dependent type name %0%1; implicit 'typename' is a C++20 extension
    • +
    • warning: range-based for loop initialization statements are a C++20 extension
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is a C++20 extension
    • +
    • warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension
    • +
    • warning: use of the %0 attribute is a C++20 extension
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++20 extension
    • +
    • warning: using declaration naming a scoped enumerator is a C++20 extension
    • +
    • warning: using enum declaration is a C++20 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-attributes - clang-diagnostic-attributes + clang-diagnostic-c++20-attribute-extensions + clang-diagnostic-c++20-attribute-extensions Diagnostic text:

      -
    • warning: %0 attribute argument not supported: %1
    • -
    • warning: %0 attribute can only be applied to instance variables or properties
    • -
    • warning: %0 attribute ignored
    • -
    • warning: %0 attribute ignored for field of type %1
    • -
    • warning: %0 attribute ignored on a non-definition declaration
    • -
    • warning: %0 attribute ignored on inline function
    • -
    • warning: %0 attribute ignored when parsing type
    • -
    • warning: %0 attribute is deprecated and ignored in %1
    • -
    • warning: %0 attribute is ignored because there exists no call expression inside the statement
    • -
    • warning: %0 attribute isn't implemented by this Objective-C runtime
    • -
    • warning: %0 attribute only applies to %1
    • -
    • warning: %0 attribute only applies to %select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters
    • -
    • warning: %0 attribute only applies to %select{functions|methods|properties}1 that return %select{an Objective-C object|a pointer|a non-retainable pointer}2
    • -
    • warning: %0 attribute only applies to %select{functions|unions|variables and functions|functions and methods|functions, methods and blocks|functions, methods, and parameters|variables|variables and fields|variables, data members and tag types|types and namespaces|variables, functions and classes|kernel functions|non-K&R-style functions}1
    • -
    • warning: %0 attribute only applies to a pointer or reference (%1 is invalid)
    • -
    • warning: %0 attribute only applies to return values that are pointers
    • -
    • warning: %0 attribute only applies to return values that are pointers or references
    • -
    • warning: %0 attribute only applies to%select{| constant}1 pointer arguments
    • -
    • warning: %0 calling convention is not supported %select{for this target|on variadic function|on constructor/destructor|on builtin function}1
    • -
    • warning: %0 currently has no effect on a using declaration
    • -
    • warning: %q0 redeclared inline; %1 attribute ignored
    • -
    • warning: %select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to functions that have %select{no parameters|a 'void' return type}1
    • -
    • warning: %select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2
    • -
    • warning: %select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden
    • -
    • warning: %select{alignment|size}0 of field %1 (%2 bits) does not match the %select{alignment|size}0 of the first field in transparent union; transparent_union attribute ignored
    • -
    • warning: %select{unsupported|duplicate|unknown}0%select{| architecture| tune CPU}1 '%2' in the '%select{target|target_clones}3' attribute string; '%select{target|target_clones}3' attribute ignored
    • -
    • warning: '%0' attribute cannot be specified on a definition
    • -
    • warning: '%0' only applies to %select{function|pointer|Objective-C object or block pointer}1 types; type here is %2
    • -
    • warning: '__clang__' is a predefined macro name, not an attribute scope specifier; did you mean '_Clang' instead?
    • -
    • warning: 'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored
    • -
    • warning: 'cmse_nonsecure_entry' cannot be applied to functions with internal linkage
    • -
    • warning: 'deprecated' attribute on anonymous namespace ignored
    • -
    • warning: 'dllexport' attribute ignored on explicit instantiation definition
    • -
    • warning: 'gnu_inline' attribute requires function to be marked 'inline', attribute ignored
    • -
    • warning: 'internal_linkage' attribute on a non-static local variable is ignored
    • -
    • warning: 'mig_server_routine' attribute only applies to routines that return a kern_return_t
    • -
    • warning: 'nocf_check' attribute ignored; use -fcf-protection to enable the attribute
    • -
    • warning: 'noderef' can only be used on an array or pointer type
    • -
    • warning: 'nonnull' attribute applied to function with no pointer arguments
    • -
    • warning: 'nonnull' attribute when used on parameters takes no arguments
    • -
    • warning: 'nothrow' attribute conflicts with exception specification; attribute ignored
    • -
    • warning: 'objc_externally_retained' can only be applied to local variables %select{of retainable type|with strong ownership}0
    • -
    • warning: 'require_constant_initialization' attribute added after initialization of variable
    • -
    • warning: 'sentinel' attribute only supported for variadic %select{functions|blocks}0
    • -
    • warning: 'sentinel' attribute requires named arguments
    • -
    • warning: 'sycl_kernel' attribute only applies to a function template with at least two template parameters
    • -
    • warning: 'trivial_abi' cannot be applied to %0
    • -
    • warning: Objective-C GC does not allow weak variables on the stack
    • -
    • warning: __declspec attribute %0 is not supported
    • -
    • warning: __weak attribute cannot be specified on a field declaration
    • -
    • warning: __weak attribute cannot be specified on an automatic variable when ARC is not enabled
    • -
    • warning: attribute %0 after definition is ignored
    • -
    • warning: attribute %0 cannot be applied to %select{functions|Objective-C method}1 without return value
    • -
    • warning: attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement
    • -
    • warning: attribute %0 has no effect when annotating an infinite loop
    • -
    • warning: attribute %0 ignored, because it cannot be applied to a type
    • -
    • warning: attribute %0 ignored, because it cannot be applied to omitted return type
    • -
    • warning: attribute %0 ignored, because it is not attached to a declaration
    • -
    • warning: attribute %0 is already applied
    • -
    • warning: attribute %0 is already applied with different arguments
    • -
    • warning: attribute %0 is ignored, place it after "%select{class|struct|interface|union|enum}1" to apply attribute to type declaration
    • -
    • warning: attribute declaration must precede definition
    • -
    • warning: conflicting attributes %0 are ignored
    • -
    • warning: direct attribute on property %0 ignored (not implemented by this Objective-C runtime)
    • -
    • warning: first field of a transparent union cannot have %select{floating point|vector}0 type %1; transparent_union attribute ignored
    • -
    • warning: function template with 'sycl_kernel' attribute must have a 'void' return type
    • -
    • warning: function template with 'sycl_kernel' attribute must have a single parameter
    • -
    • warning: ignoring __declspec(allocator) because the function return type %0 is not a pointer or reference type
    • -
    • warning: import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the previous declaration
    • -
    • warning: import %select{module|name}0 cannot be applied to a function with a definition
    • -
    • warning: inheritance model ignored on %select{primary template|partial specialization}0
    • -
    • warning: qualifiers after comma in declarator list are ignored
    • -
    • warning: repeated RISC-V 'interrupt' attribute
    • -
    • warning: requested alignment is less than minimum alignment of %1 for type %0
    • -
    • warning: template parameter of a function template with the 'sycl_kernel' attribute cannot be a non-type template parameter
    • -
    • warning: transparent union definition must contain at least one field; transparent_union attribute ignored
    • -
    • warning: transparent_union attribute can only be applied to a union definition; attribute ignored
    • -
    • warning: unknown attribute %0 ignored
    • -
    • warning: unknown attribute '%0'
    • -
    • warning: unknown visibility %0
    • +
    • warning: use of the %0 attribute is a C++20 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-auto-disable-vptr-sanitizer - clang-diagnostic-auto-disable-vptr-sanitizer + clang-diagnostic-c++20-compat + clang-diagnostic-c++20-compat Diagnostic text:

      -
    • warning: implicitly disabling vptr sanitizer because rtti wasn't enabled
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: '%0' is a keyword in C++20
    • +
    • warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'consteval' specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'constinit' specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: aggregate initialization of type %0 with user-declared constructors is incompatible with C++20
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: taking address of non-addressable standard library function is incompatible with C++20
    • +
    • warning: this expression will be parsed as explicit(bool) in C++20
    • +
    • warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of implicit 'typename' is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-auto-import - clang-diagnostic-auto-import + clang-diagnostic-c++20-compat-pedantic + clang-diagnostic-c++20-compat-pedantic Diagnostic text:

      -
    • warning: treating #%select{include|import|include_next|__include_macros}0 as an import of module '%1'
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: '%0' is a keyword in C++20
    • +
    • warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'consteval' specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'constinit' specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: aggregate initialization of type %0 with user-declared constructors is incompatible with C++20
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: taking address of non-addressable standard library function is incompatible with C++20
    • +
    • warning: this expression will be parsed as explicit(bool) in C++20
    • +
    • warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of implicit 'typename' is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-arc - clang-diagnostic-arc + clang-diagnostic-c++20-designator + clang-diagnostic-c++20-designator Diagnostic text:

      -
    • warning: %select{destination for|source of}0 this %1 call is a pointer to ownership-qualified type %2
    • -
    • warning: assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0 to a weak %select{property|variable}1; object will be released after assignment
    • -
    • warning: assigning retained object to %select{weak|unsafe_unretained}0 %select{property|variable}1; object will be released after assignment
    • -
    • warning: assigning retained object to unsafe property; object will be released after assignment
    • -
    • warning: capturing %0 strongly in this block is likely to lead to a retain cycle
    • +
    • warning: designated initializers are a C++20 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-availability - clang-diagnostic-availability + clang-diagnostic-c++23-extensions + clang-diagnostic-c++23-extensions Diagnostic text:

      -
    • warning: %select{|overriding }1method cannot be unavailable on %0 when %select{the protocol method it implements|its overridden method}1 is available
    • -
    • warning: %select{|overriding }4method %select{introduced after|deprecated before|obsoleted before}0 %select{the protocol method it implements|overridden method}4 on %1 (%2 vs. %3)
    • -
    • warning: 'unavailable' availability overrides all other availability information
    • -
    • warning: Fuchsia API Level prohibits specifying a minor or sub-minor version
    • -
    • warning: availability does not match previous declaration
    • -
    • warning: feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version %2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; attribute ignored
    • -
    • warning: ignoring availability attribute %select{on '+load' method|with constructor attribute|with destructor attribute}0
    • -
    • warning: only 'unavailable' and 'deprecated' are supported for Swift availability
    • -
    • warning: unknown platform %0 in availability macro
    • -
    • warning: use same version number separators '_' or '.'; as in 'major[.minor[.subminor]]'
    • +
    • warning: %select{an attribute specifier sequence|%0}1 in this position is a C++23 extension
    • +
    • warning: 'size_t' suffix for literals is a C++23 extension
    • +
    • warning: alias declaration in this context is a C++23 extension
    • +
    • warning: consteval if is a C++23 extension
    • +
    • warning: declaring overloaded %0 as 'static' is a C++23 extension
    • +
    • warning: definition of a %select{static|thread_local}1 variable in a constexpr %select{function|constructor}0 is a C++23 extension
    • +
    • warning: label at end of compound statement is a C++23 extension
    • +
    • warning: lambda without a parameter clause is a C++23 extension
    • +
    • warning: static lambdas are a C++23 extension
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is a C++23 extension
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++23 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-frame-larger-than - clang-diagnostic-frame-larger-than + clang-diagnostic-c++23-lambda-attributes + clang-diagnostic-c++23-lambda-attributes Diagnostic text:

      -
    • warning: %0
    • -
    • warning: stack frame size (%0) exceeds limit (%1) in '%2'
    • +
    • warning: %select{an attribute specifier sequence|%0}1 in this position is a C++23 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-inline-asm - clang-diagnostic-inline-asm + clang-diagnostic-c++26-extensions + clang-diagnostic-c++26-extensions Diagnostic text:

      -
    • warning: %0
    • +
    • warning: placeholder variables are a C++2c extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pass-failed - clang-diagnostic-pass-failed + clang-diagnostic-c++98-compat + clang-diagnostic-c++98-compat Diagnostic text:

      -
    • warning: %0
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{anonymous struct|union}0 member %1 with a non-trivial %sub{select_special_member_kind}2 is incompatible with C++98
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{defaulted|deleted}0 function definitions are incompatible with C++98
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: '%0' keyword is incompatible with C++98
    • +
    • warning: '%0' type specifier is incompatible with C++98
    • +
    • warning: '<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'alignas' is incompatible with C++98
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' type specifier is incompatible with C++98
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'constexpr' specifier is incompatible with C++98
    • +
    • warning: 'decltype' type specifier is incompatible with C++98
    • +
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • +
    • warning: 'nullptr' is incompatible with C++98
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'static_assert' declarations are incompatible with C++98
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: [[]] attributes are incompatible with C++ standards before C++11
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: alias declarations are incompatible with C++98
    • +
    • warning: alignof expressions are incompatible with C++98
    • +
    • warning: befriending %1 without '%select{struct|interface|union|class|enum}0' keyword is incompatible with C++98
    • +
    • warning: befriending enumeration type %0 is incompatible with C++98
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: consecutive right angle brackets are incompatible with C++98 (use '> >')
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: constructor call from initializer list is incompatible with C++98
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for non-static data members is incompatible with C++98
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: default template arguments for a function template are incompatible with C++98
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: delegating constructors are incompatible with C++98
    • +
    • warning: digit separators are incompatible with C++ standards before C++14
    • +
    • warning: enumeration type in nested name specifier is incompatible with C++98
    • +
    • warning: enumeration types with a fixed underlying type are incompatible with C++98
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit conversion functions are incompatible with C++98
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: friend declaration naming a member of the declaring class is incompatible with C++98
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: generalized initializer lists are incompatible with C++98
    • +
    • warning: generic lambdas are incompatible with C++11
    • +
    • warning: inheriting constructors are incompatible with C++98
    • +
    • warning: initialization of initializer_list object is incompatible with C++98
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • +
    • warning: initializing %0 from an empty initializer list is incompatible with C++98
    • +
    • warning: inline namespaces are incompatible with C++98
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: jump from switch statement to this case label is incompatible with C++98
    • +
    • warning: jump from this %select{indirect|asm}0 goto statement to one of its possible targets is incompatible with C++98
    • +
    • warning: jump from this goto statement to its label is incompatible with C++98
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: lambda expressions are incompatible with C++98
    • +
    • warning: literal operators are incompatible with C++98
    • +
    • warning: local type %0 as template argument is incompatible with C++98
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: noexcept expressions are incompatible with C++98
    • +
    • warning: noexcept specifications are incompatible with C++98
    • +
    • warning: non-class friend type %0 is incompatible with C++98
    • +
    • warning: non-type template argument referring to %select{function|object}0 %1 with internal linkage is incompatible with C++98
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: passing object of trivial but non-POD type %0 through variadic %select{function|block|method|constructor}1 is incompatible with C++98
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop is incompatible with C++98
    • +
    • warning: raw string literals are incompatible with C++98
    • +
    • warning: redundant parentheses surrounding address non-type template argument are incompatible with C++98
    • +
    • warning: reference initialized from initializer list is incompatible with C++98
    • +
    • warning: reference qualifiers on functions are incompatible with C++98
    • +
    • warning: return type deduction is incompatible with C++ standards before C++14
    • +
    • warning: rvalue references are incompatible with C++98
    • +
    • warning: scalar initialized from empty initializer list is incompatible with C++98
    • +
    • warning: scoped enumerations are incompatible with C++98
    • +
    • warning: specifying character '%0' with a universal character name is incompatible with C++98
    • +
    • warning: static data member %0 in union is incompatible with C++98
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: substitution failure due to access control is incompatible with C++98
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: trailing return types are incompatible with C++98
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++98
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: universal character name referring to a control character is incompatible with C++98
    • +
    • warning: unnamed type as template argument is incompatible with C++98
    • +
    • warning: use of 'template' keyword outside of a template is incompatible with C++98
    • +
    • warning: use of 'typename' outside of a template is incompatible with C++98
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of non-static data member %0 in an unevaluated context is incompatible with C++98
    • +
    • warning: use of null pointer as non-type template argument is incompatible with C++98
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable templates are incompatible with C++ standards before C++14
    • +
    • warning: variadic templates are incompatible with C++98
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pass - clang-diagnostic-pass + clang-diagnostic-c++98-compat-bind-to-temporary-copy + clang-diagnostic-c++98-compat-bind-to-temporary-copy Diagnostic text:

      -
    • remark: %0
    • +
    • warning: %sub{select_initialized_entity_kind}1 of type %2 when binding a reference to a temporary would %select{invoke an inaccessible constructor|find no viable constructor|find ambiguous constructors|invoke a deleted constructor}0 in C++98

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pass-analysis - clang-diagnostic-pass-analysis + clang-diagnostic-c++98-compat-extra-semi + clang-diagnostic-c++98-compat-extra-semi Diagnostic text:

      -
    • remark: %0
    • -
    • remark: %0; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop or by providing the compiler option '-ffast-math'.
    • -
    • remark: %0; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop. If the arrays will always be independent specify '#pragma clang loop vectorize(assume_safety)' before the loop or provide the '__restrict__' qualifier with the independent array arguments. Erroneous results will occur if these options are incorrectly applied!
    • +
    • warning: extra ';' outside of a function is incompatible with C++98

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pass-missed - clang-diagnostic-pass-missed + clang-diagnostic-c++98-compat-local-type-template-args + clang-diagnostic-c++98-compat-local-type-template-args Diagnostic text:

      -
    • remark: %0
    • +
    • warning: local type %0 as template argument is incompatible with C++98

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-backend-plugin - clang-diagnostic-backend-plugin + clang-diagnostic-c++98-compat-pedantic + clang-diagnostic-c++98-compat-pedantic Diagnostic text:

      -
    • warning: %0
    • +
    • warning: #line number greater than 32767 is incompatible with C++98
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{anonymous struct|union}0 member %1 with a non-trivial %sub{select_special_member_kind}2 is incompatible with C++98
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{defaulted|deleted}0 function definitions are incompatible with C++98
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: %sub{select_initialized_entity_kind}1 of type %2 when binding a reference to a temporary would %select{invoke an inaccessible constructor|find no viable constructor|find ambiguous constructors|invoke a deleted constructor}0 in C++98
    • +
    • warning: '%0' keyword is incompatible with C++98
    • +
    • warning: '%0' type specifier is incompatible with C++98
    • +
    • warning: '<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'alignas' is incompatible with C++98
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' type specifier is incompatible with C++98
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'constexpr' specifier is incompatible with C++98
    • +
    • warning: 'decltype' type specifier is incompatible with C++98
    • +
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • +
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • +
    • warning: 'long long' is incompatible with C++98
    • +
    • warning: 'nullptr' is incompatible with C++98
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'static_assert' declarations are incompatible with C++98
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: C++98 requires newline at end of file
    • +
    • warning: [[]] attributes are incompatible with C++ standards before C++11
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: alias declarations are incompatible with C++98
    • +
    • warning: alignof expressions are incompatible with C++98
    • +
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
    • +
    • warning: befriending %1 without '%select{struct|interface|union|class|enum}0' keyword is incompatible with C++98
    • +
    • warning: befriending enumeration type %0 is incompatible with C++98
    • +
    • warning: binary integer literals are incompatible with C++ standards before C++14
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: cast between pointer-to-function and pointer-to-object is incompatible with C++98
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: commas at the end of enumerator lists are incompatible with C++98
    • +
    • warning: consecutive right angle brackets are incompatible with C++98 (use '> >')
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • +
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: constructor call from initializer list is incompatible with C++98
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for non-static data members is incompatible with C++98
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: default template arguments for a function template are incompatible with C++98
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: delegating constructors are incompatible with C++98
    • +
    • warning: designated initializers are incompatible with C++ standards before C++20
    • +
    • warning: digit separators are incompatible with C++ standards before C++14
    • +
    • warning: digit separators are incompatible with C++ standards before C++14
    • +
    • warning: empty macro arguments are incompatible with C++98
    • +
    • warning: enumeration type in nested name specifier is incompatible with C++98
    • +
    • warning: enumeration types with a fixed underlying type are incompatible with C++98
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit conversion functions are incompatible with C++98
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: extern templates are incompatible with C++98
    • +
    • warning: extra ';' outside of a function is incompatible with C++98
    • +
    • warning: friend declaration naming a member of the declaring class is incompatible with C++98
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: generalized initializer lists are incompatible with C++98
    • +
    • warning: generic lambdas are incompatible with C++11
    • +
    • warning: generic lambdas are incompatible with C++11
    • +
    • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
    • +
    • warning: implicit conversion from array size expression of type %0 to %select{integral|enumeration}1 type %2 is incompatible with C++98
    • +
    • warning: inheriting constructors are incompatible with C++98
    • +
    • warning: initialization of initializer_list object is incompatible with C++98
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • +
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • +
    • warning: initializing %0 from an empty initializer list is incompatible with C++98
    • +
    • warning: inline namespaces are incompatible with C++98
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • +
    • warning: jump from switch statement to this case label is incompatible with C++98
    • +
    • warning: jump from this %select{indirect|asm}0 goto statement to one of its possible targets is incompatible with C++98
    • +
    • warning: jump from this goto statement to its label is incompatible with C++98
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: lambda expressions are incompatible with C++98
    • +
    • warning: literal operators are incompatible with C++98
    • +
    • warning: local type %0 as template argument is incompatible with C++98
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • +
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: noexcept expressions are incompatible with C++98
    • +
    • warning: noexcept specifications are incompatible with C++98
    • +
    • warning: non-class friend type %0 is incompatible with C++98
    • +
    • warning: non-type template argument referring to %select{function|object}0 %1 with internal linkage is incompatible with C++98
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: passing object of trivial but non-POD type %0 through variadic %select{function|block|method|constructor}1 is incompatible with C++98
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop is incompatible with C++98
    • +
    • warning: raw string literals are incompatible with C++98
    • +
    • warning: redundant parentheses surrounding address non-type template argument are incompatible with C++98
    • +
    • warning: reference initialized from initializer list is incompatible with C++98
    • +
    • warning: reference qualifiers on functions are incompatible with C++98
    • +
    • warning: return type deduction is incompatible with C++ standards before C++14
    • +
    • warning: return type deduction is incompatible with C++ standards before C++14
    • +
    • warning: rvalue references are incompatible with C++98
    • +
    • warning: scalar initialized from empty initializer list is incompatible with C++98
    • +
    • warning: scoped enumerations are incompatible with C++98
    • +
    • warning: specifying character '%0' with a universal character name is incompatible with C++98
    • +
    • warning: static data member %0 in union is incompatible with C++98
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: substitution failure due to access control is incompatible with C++98
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: trailing return types are incompatible with C++98
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++98
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: universal character name referring to a control character is incompatible with C++98
    • +
    • warning: unnamed type as template argument is incompatible with C++98
    • +
    • warning: use of 'template' keyword outside of a template is incompatible with C++98
    • +
    • warning: use of 'typename' outside of a template is incompatible with C++98
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of non-static data member %0 in an unevaluated context is incompatible with C++98
    • +
    • warning: use of null pointer as non-type template argument is incompatible with C++98
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable templates are incompatible with C++ standards before C++14
    • +
    • warning: variable templates are incompatible with C++ standards before C++14
    • +
    • warning: variadic macros are incompatible with C++98
    • +
    • warning: variadic templates are incompatible with C++98
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-source-mgr - clang-diagnostic-source-mgr + clang-diagnostic-c++98-compat-unnamed-type-template-args + clang-diagnostic-c++98-compat-unnamed-type-template-args Diagnostic text:

      -
    • warning: %0
    • +
    • warning: unnamed type as template argument is incompatible with C++98

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-attribute-warning - clang-diagnostic-attribute-warning + clang-diagnostic-c++-compat + clang-diagnostic-c++-compat Diagnostic text:

      -
    • warning: call to %0 declared with 'warning' attribute: %1
    • +
    • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-bad-function-cast - clang-diagnostic-bad-function-cast + clang-diagnostic-pre-c++14-compat + clang-diagnostic-pre-c++14-compat Diagnostic text:

      -
    • warning: cast from function call of type %0 to non-matching type %1
    • +
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • +
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • +
    • warning: digit separators are incompatible with C++ standards before C++14
    • +
    • warning: generic lambdas are incompatible with C++11
    • +
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • +
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • +
    • warning: return type deduction is incompatible with C++ standards before C++14
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable templates are incompatible with C++ standards before C++14

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-binary-literal - clang-diagnostic-binary-literal + clang-diagnostic-c++98-c++11-compat-binary-literal + clang-diagnostic-c++98-c++11-compat-binary-literal Diagnostic text:

      -
    • warning: binary integer literals are a C++14 extension
    • -
    • warning: binary integer literals are a GNU extension
    • warning: binary integer literals are incompatible with C++ standards before C++14

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-bind-to-temporary-copy - clang-diagnostic-bind-to-temporary-copy - - Diagnostic text:

    -
      -
    • warning: %sub{select_initialized_entity_kind}1 of type %2 when binding a reference to a temporary would %select{invoke an inaccessible constructor|find no viable constructor|find ambiguous constructors|invoke a deleted constructor}0 in C++98
    • -
    • warning: C++98 requires an accessible copy constructor for class %2 when binding a reference to a temporary; was %select{private|protected}0
    • -
    • warning: no viable constructor %sub{select_initialized_entity_kind}0 of type %1; C++98 requires a copy constructor when binding a reference to a temporary
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-bitfield-constant-conversion - clang-diagnostic-bitfield-constant-conversion - - Diagnostic text:

    -
      -
    • warning: implicit truncation from %2 to bit-field changes value from %0 to %1
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-bitfield-enum-conversion - clang-diagnostic-bitfield-enum-conversion - - Diagnostic text:

    -
      -
    • warning: assigning value of signed enum type %1 to unsigned bit-field %0; negative enumerators of enum %1 will be converted to positive values
    • -
    • warning: bit-field %0 is not wide enough to store all enumerators of %1
    • -
    • warning: signed bit-field %0 needs an extra bit to represent the largest positive enumerators of %1
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-bitfield-width - clang-diagnostic-bitfield-width - - Diagnostic text:

    -
      -
    • warning: width of bit-field %0 (%1 bits) exceeds the width of its type; value will be truncated to %2 bit%s2
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-bitwise-conditional-parentheses - clang-diagnostic-bitwise-conditional-parentheses + clang-diagnostic-pre-c++14-compat-pedantic + clang-diagnostic-pre-c++14-compat-pedantic Diagnostic text:

      -
    • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
    • +
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • +
    • warning: binary integer literals are incompatible with C++ standards before C++14
    • +
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • +
    • warning: digit separators are incompatible with C++ standards before C++14
    • +
    • warning: generic lambdas are incompatible with C++11
    • +
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • +
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • +
    • warning: return type deduction is incompatible with C++ standards before C++14
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable templates are incompatible with C++ standards before C++14

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-bitwise-instead-of-logical - clang-diagnostic-bitwise-instead-of-logical + clang-diagnostic-pre-c++17-compat + clang-diagnostic-pre-c++17-compat Diagnostic text:

      -
    • warning: use of bitwise '%0' with boolean operands
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-bitwise-op-parentheses - clang-diagnostic-bitwise-op-parentheses + clang-diagnostic-pre-c++17-compat-pedantic + clang-diagnostic-pre-c++17-compat-pedantic Diagnostic text:

      -
    • warning: '%0' within '%1'
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-block-capture-autoreleasing - clang-diagnostic-block-capture-autoreleasing + clang-diagnostic-pre-c++20-compat + clang-diagnostic-pre-c++20-compat Diagnostic text:

      -
    • warning: block captures an autoreleasing out-parameter, which may result in use-after-free bugs
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-bool-conversion - clang-diagnostic-bool-conversion + clang-diagnostic-pre-c++20-compat-pedantic + clang-diagnostic-pre-c++20-compat-pedantic Diagnostic text:

      -
    • warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
    • -
    • warning: address of%select{| function| array}0 '%1' will always evaluate to 'true'
    • -
    • warning: initialization of pointer of type %0 to null from a constant boolean expression
    • -
    • warning: nonnull %select{function call|parameter}0 '%1' will evaluate to 'true' on first encounter
    • -
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: designated initializers are incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-bool-operation - clang-diagnostic-bool-operation + clang-diagnostic-pre-c++2b-compat + clang-diagnostic-pre-c++2b-compat Diagnostic text:

      -
    • warning: bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 did you mean logical negation?
    • -
    • warning: use of bitwise '%0' with boolean operands
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • +
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • +
    • warning: consteval if is incompatible with C++ standards before C++2b
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-branch-protection - clang-diagnostic-branch-protection + clang-diagnostic-pre-c++23-compat + clang-diagnostic-pre-c++23-compat Diagnostic text:

      -
    • warning: '-mbranch-protection=' option is incompatible with the '%0' architecture
    • -
    • warning: ignoring the 'branch-protection' attribute because the '%0' architecture does not support it
    • -
    • warning: invalid branch protection option '%0' in '%1'
    • -
    • warning: unsupported branch protection specification '%0'
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-builtin-macro-redefined - clang-diagnostic-builtin-macro-redefined + clang-diagnostic-pre-c++2b-compat-pedantic + clang-diagnostic-pre-c++2b-compat-pedantic Diagnostic text:

      -
    • warning: redefining builtin macro
    • -
    • warning: undefining builtin macro
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • +
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • +
    • warning: consteval if is incompatible with C++ standards before C++2b
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-builtin-requires-header - clang-diagnostic-builtin-requires-header + clang-diagnostic-pre-c++23-compat-pedantic + clang-diagnostic-pre-c++23-compat-pedantic Diagnostic text:

      -
    • warning: declaration of built-in function '%1' requires inclusion of the header <%0>
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c11-extensions - clang-diagnostic-c11-extensions + clang-diagnostic-pre-c++26-compat + clang-diagnostic-pre-c++26-compat Diagnostic text:

      -
    • warning: '%0' is a C11 extension
    • -
    • warning: anonymous structs are a C11 extension
    • -
    • warning: anonymous unions are a C11 extension
    • -
    • warning: pointer comparisons before C11 need to be between two complete or two incomplete types; %0 is %select{|in}2complete and %1 is %select{|in}3complete
    • +
    • warning: placeholder variables are incompatible with C++ standards before C++2c

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c2x-extensions - clang-diagnostic-c2x-extensions + clang-diagnostic-pre-c++26-compat-pedantic + clang-diagnostic-pre-c++26-compat-pedantic Diagnostic text:

      -
    • warning: '_Static_assert' with no message is a C2x extension
    • -
    • warning: omitting the parameter name in a function definition is a C2x extension
    • +
    • warning: placeholder variables are incompatible with C++ standards before C++2c

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c99-extensions - clang-diagnostic-c99-extensions + clang-diagnostic-called-once-parameter + clang-diagnostic-called-once-parameter Diagnostic text:

      -
    • warning: %select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 feature
    • -
    • warning: '%0' is a C99 extension
    • -
    • warning: ISO C99 requires whitespace after the macro name
    • -
    • warning: array designators are a C99 extension
    • -
    • warning: brace elision for designated initializer is a C99 extension
    • -
    • warning: commas at the end of enumerator lists are a C99-specific feature
    • -
    • warning: compound literals are a C99-specific feature
    • -
    • warning: designated initializers are a C++20 extension
    • -
    • warning: designated initializers are a C99 feature
    • -
    • warning: empty macro arguments are a C99 feature
    • -
    • warning: flexible array members are a C99 feature
    • -
    • warning: hexadecimal floating constants are a C99 feature
    • -
    • warning: initializer for aggregate is not a compile-time constant
    • -
    • warning: mixture of designated and non-designated initializers in the same initializer list is a C99 extension
    • -
    • warning: nested designators are a C99 extension
    • -
    • warning: variable declaration in for loop is a C99-specific feature
    • +
    • warning: %0 parameter marked 'called_once' is called twice
    • +
    • warning: %0 parameter marked 'called_once' is never %select{used|called}1 when %select{taking true branch|taking false branch|handling this case|none of the cases applies|entering the loop|skipping the loop|taking one of the branches}2
    • +
    • warning: %select{|captured }1%0 parameter marked 'called_once' is never called
    • +
    • warning: %select{|captured }1completion handler is never called
    • +
    • warning: completion handler is called twice
    • +
    • warning: completion handler is never %select{used|called}1 when %select{taking true branch|taking false branch|handling this case|none of the cases applies|entering the loop|skipping the loop|taking one of the branches}2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c99-compat - clang-diagnostic-c99-compat + clang-diagnostic-cast-align + clang-diagnostic-cast-align Diagnostic text:

      -
    • warning: %select{using this character in an identifier|starting an identifier with this character}0 is incompatible with C99
    • -
    • warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C89; this literal will %select{have type 'long long'|be ill-formed}0 in C99 onwards
    • -
    • warning: unicode literals are incompatible with C99
    • +
    • warning: cast from %0 to %1 increases required alignment from %2 to %3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c99-designator - clang-diagnostic-c99-designator + clang-diagnostic-cast-function-type + clang-diagnostic-cast-function-type Diagnostic text:

      -
    • warning: array designators are a C99 extension
    • -
    • warning: brace elision for designated initializer is a C99 extension
    • -
    • warning: designated initializers are a C++20 extension
    • -
    • warning: designated initializers are a C99 feature
    • -
    • warning: mixture of designated and non-designated initializers in the same initializer list is a C99 extension
    • -
    • warning: nested designators are a C99 extension
    • +
    • warning: cast %diff{from $ to $ |}0,1converts to incompatible function type
    • +
    • warning: cast %diff{from $ to $ |}0,1converts to incompatible function type

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c2x-compat - clang-diagnostic-pre-c2x-compat + clang-diagnostic-cast-function-type-strict + clang-diagnostic-cast-function-type-strict Diagnostic text:

      -
    • warning: '_BitInt' is incompatible with C standards before C2x
    • -
    • warning: '_Static_assert' with no message is incompatible with C standards before C2x
    • -
    • warning: digit separators are incompatible with C standards before C2x
    • +
    • warning: cast %diff{from $ to $ |}0,1converts to incompatible function type

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c2x-compat-pedantic - clang-diagnostic-pre-c2x-compat-pedantic + clang-diagnostic-cast-qual + clang-diagnostic-cast-qual Diagnostic text:

      -
    • warning: '_BitInt' is incompatible with C standards before C2x
    • -
    • warning: '_Static_assert' with no message is incompatible with C standards before C2x
    • -
    • warning: digit separators are incompatible with C standards before C2x
    • +
    • warning: cast from %0 to %1 drops %select{const and volatile qualifiers|const qualifier|volatile qualifier}2
    • +
    • warning: cast from %0 to %1 must have all intermediate pointers const qualified to be safe

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ctad-maybe-unsupported - clang-diagnostic-ctad-maybe-unsupported + clang-diagnostic-char-subscripts + clang-diagnostic-char-subscripts Diagnostic text:

      -
    • warning: %0 may not intend to support class template argument deduction
    • +
    • warning: array section %select{lower bound|length}0 is of type 'char'
    • +
    • warning: array subscript is of type 'char'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++11-extensions - clang-diagnostic-c++11-extensions + clang-diagnostic-clang-cl-pch + clang-diagnostic-clang-cl-pch Diagnostic text:

      -
    • warning: %select{defaulted|deleted}0 function definitions are a C++11 extension
    • -
    • warning: '%0' keyword is a C++11 extension
    • -
    • warning: 'auto' type specifier is a C++11 extension
    • -
    • warning: 'long long' is a C++11 extension
    • -
    • warning: 'template' keyword outside of a template
    • -
    • warning: 'typename' occurs outside of a template
    • -
    • warning: alias declarations are a C++11 extension
    • -
    • warning: befriending enumeration type %0 is a C++11 extension
    • -
    • warning: commas at the end of enumerator lists are a C++11 extension
    • -
    • warning: default member initializer for non-static data member is a C++11 extension
    • -
    • warning: default template arguments for a function template are a C++11 extension
    • -
    • warning: enumeration types with a fixed underlying type are a C++11 extension
    • -
    • warning: explicit conversion functions are a C++11 extension
    • -
    • warning: extern templates are a C++11 extension
    • -
    • warning: extra ';' outside of a function is a C++11 extension
    • -
    • warning: generalized initializer lists are a C++11 extension
    • -
    • warning: implicit conversion from array size expression of type %0 to %select{integral|enumeration}1 type %2 is a C++11 extension
    • -
    • warning: inline namespaces are a C++11 feature
    • -
    • warning: non-class friend type %0 is a C++11 extension
    • -
    • warning: non-type template argument referring to %select{function|object}0 %1 with internal linkage is a C++11 extension
    • -
    • warning: range-based for loop is a C++11 extension
    • -
    • warning: reference qualifiers on functions are a C++11 extension
    • -
    • warning: rvalue references are a C++11 extension
    • -
    • warning: scoped enumerations are a C++11 extension
    • -
    • warning: static data member %0 in union is a C++11 extension
    • -
    • warning: unelaborated friend declaration is a C++11 extension; specify '%select{struct|interface|union|class|enum}0' to befriend %1
    • -
    • warning: use of enumeration in a nested name specifier is a C++11 extension
    • -
    • warning: variadic templates are a C++11 extension
    • +
    • warning: #pragma hdrstop filename not supported, /Fp can be used to specify precompiled header filename
    • +
    • warning: definition of macro %0 does not match definition in precompiled header
    • +
    • warning: support for '/Yc' and '/Yu' with different filenames not implemented yet; flags ignored
    • +
    • warning: support for '/Yc' with more than one source file not implemented yet; flag ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++11-compat - clang-diagnostic-c++11-compat + clang-diagnostic-class-conversion + clang-diagnostic-class-conversion Diagnostic text:

      -
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: '%0' is a keyword in C++11
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'auto' storage class specifier is redundant and incompatible with C++11
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: conversion from string literal to %0 is deprecated
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit instantiation cannot be 'inline'
    • -
    • warning: explicit instantiation of %0 must occur at global scope
    • -
    • warning: explicit instantiation of %0 not in a namespace enclosing %1
    • -
    • warning: explicit instantiation of %q0 must occur in namespace %1
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    • -
    • warning: identifier after literal will be treated as a user-defined literal suffix in C++11
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • -
    • warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C++98; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of right-shift operator ('>>') in template argument will require parentheses in C++11
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: conversion function converting %0 to %1 will never be used
    • +
    • warning: conversion function converting %0 to its base class %1 will never be used
    • +
    • warning: conversion function converting %0 to itself will never be used
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-class-varargs + clang-diagnostic-class-varargs + + Diagnostic text:

    +
      +
    • warning: cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic %select{function|block|method|constructor}2; expected type from format string was %3
    • +
    • warning: cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic %select{function|block|method|constructor}2; call will abort at runtime
    • +
    • warning: passing object of class type %0 through variadic %select{function|block|method|constructor}1%select{|; did you mean to call '%3'?}2
    • +
    • warning: second argument to 'va_arg' is of ARC ownership-qualified type %0
    • +
    • warning: second argument to 'va_arg' is of non-POD type %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    CRITICAL
    - clang-diagnostic-c++11-compat-deprecated-writable-strings - clang-diagnostic-c++11-compat-deprecated-writable-strings + clang-diagnostic-comment + clang-diagnostic-comment Diagnostic text:

      -
    • warning: conversion from string literal to %0 is deprecated
    • +
    • warning: '/*' within block comment
    • +
    • warning: // comments are not allowed in this language
    • +
    • warning: escaped newline between */ characters at block comment end
    • +
    • warning: multi-line // comment

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++11-compat-pedantic - clang-diagnostic-c++11-compat-pedantic + clang-diagnostic-compare-distinct-pointer-types + clang-diagnostic-compare-distinct-pointer-types Diagnostic text:

      -
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: '%0' is a keyword in C++11
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'auto' storage class specifier is redundant and incompatible with C++11
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
    • -
    • warning: binary integer literals are incompatible with C++ standards before C++14
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: conversion from string literal to %0 is deprecated
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: designated initializers are incompatible with C++ standards before C++20
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit instantiation cannot be 'inline'
    • -
    • warning: explicit instantiation of %0 must occur at global scope
    • -
    • warning: explicit instantiation of %0 not in a namespace enclosing %1
    • -
    • warning: explicit instantiation of %q0 must occur in namespace %1
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
    • -
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    • -
    • warning: identifier after literal will be treated as a user-defined literal suffix in C++11
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • -
    • warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C++98; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • -
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of right-shift operator ('>>') in template argument will require parentheses in C++11
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: comparison of distinct pointer types%diff{ ($ and $)|}0,1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-c++11-compat-reserved-user-defined-literal - clang-diagnostic-c++11-compat-reserved-user-defined-literal + clang-diagnostic-completion-handler + clang-diagnostic-completion-handler Diagnostic text:

      -
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    • +
    • warning: %select{|captured }1completion handler is never called
    • +
    • warning: completion handler is called twice
    • +
    • warning: completion handler is never %select{used|called}1 when %select{taking true branch|taking false branch|handling this case|none of the cases applies|entering the loop|skipping the loop|taking one of the branches}2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++11-extra-semi - clang-diagnostic-c++11-extra-semi + clang-diagnostic-compound-token-split + clang-diagnostic-compound-token-split Diagnostic text:

      -
    • warning: extra ';' outside of a function is a C++11 extension
    • +
    • warning: %sub{subst_compound_token_kind}0,1,2,3 appear in different macro expansion contexts
    • +
    • warning: %sub{subst_compound_token_kind}0,1,2,3 are separated by whitespace

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++11-inline-namespace - clang-diagnostic-c++11-inline-namespace + clang-diagnostic-compound-token-split-by-macro + clang-diagnostic-compound-token-split-by-macro Diagnostic text:

      -
    • warning: inline namespaces are a C++11 feature
    • +
    • warning: %sub{subst_compound_token_kind}0,1,2,3 appear in different macro expansion contexts

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++11-long-long - clang-diagnostic-c++11-long-long + clang-diagnostic-compound-token-split-by-space + clang-diagnostic-compound-token-split-by-space Diagnostic text:

      -
    • warning: 'long long' is a C++11 extension
    • +
    • warning: %sub{subst_compound_token_kind}0,1,2,3 are separated by whitespace

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++11-narrowing - clang-diagnostic-c++11-narrowing + clang-diagnostic-config-macros + clang-diagnostic-config-macros Diagnostic text:

      -
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    • +
    • warning: %select{definition|#undef}0 of configuration macro '%1' has no effect on the import of '%2'; pass '%select{-D%1=...|-U%1}0' on the command line to configure the module

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-inconsistent-missing-destructor-override - clang-diagnostic-inconsistent-missing-destructor-override + clang-diagnostic-constant-conversion + clang-diagnostic-constant-conversion Diagnostic text:

      -
    • warning: %sub{warn_destructor_marked_not_override_overriding}0
    • +
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • +
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: implicit truncation from %2 to a one-bit wide bit-field changes value from %0 to %1
    • +
    • warning: implicit truncation from %2 to bit-field changes value from %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-inconsistent-missing-override - clang-diagnostic-inconsistent-missing-override + clang-diagnostic-consumed + clang-diagnostic-consumed Diagnostic text:

      -
    • warning: %sub{warn_function_marked_not_override_overriding}0
    • +
    • warning: argument not in expected state; expected '%0', observed '%1'
    • +
    • warning: consumed analysis attribute is attached to member of class %0 which isn't marked as consumable
    • +
    • warning: invalid invocation of method '%0' on a temporary object while it is in the '%1' state
    • +
    • warning: invalid invocation of method '%0' on object '%1' while it is in the '%2' state
    • +
    • warning: parameter '%0' not in expected state when the function returns: expected '%1', observed '%2'
    • +
    • warning: return state set for an unconsumable type '%0'
    • +
    • warning: return value not in expected state; expected '%0', observed '%1'
    • +
    • warning: state of variable '%0' must match at the entry and exit of loop

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - - clang-diagnostic-suggest-override - clang-diagnostic-suggest-override + + clang-diagnostic-conversion + clang-diagnostic-conversion Diagnostic text:

      -
    • warning: %sub{warn_function_marked_not_override_overriding}0
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    • warning: address of%select{| function| array}0 '%1' will always evaluate to 'true'
    • +
    • warning: assigning value of signed enum type %1 to unsigned bit-field %0; negative enumerators of enum %1 will be converted to positive values
    • +
    • warning: bit-field %0 is not wide enough to store all enumerators of %1
    • +
    • warning: expression which evaluates to zero treated as a null pointer constant of type %0
    • +
    • warning: higher order bits are zeroes after implicit conversion
    • +
    • warning: implicit boolean conversion of Objective-C object literal always evaluates to true
    • +
    • warning: implicit conversion changes signedness: %0 to %1
    • +
    • warning: implicit conversion discards imaginary component: %0 to %1
    • +
    • warning: implicit conversion from %0 to %1 changes non-zero value from %2 to %3
    • +
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • +
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • +
    • warning: implicit conversion from %0 to %1 may lose precision
    • +
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • +
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • +
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: implicit conversion from enumeration type %0 to different enumeration type %1
    • +
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • +
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • +
    • warning: implicit conversion loses floating-point precision: %0 to %1
    • +
    • warning: implicit conversion loses integer precision: %0 to %1
    • +
    • warning: implicit conversion loses integer precision: %0 to %1
    • +
    • warning: implicit conversion of %select{NULL|nullptr}0 constant to %1
    • +
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • +
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • +
    • warning: implicit conversion turns floating-point number into integer: %0 to %1
    • +
    • warning: implicit conversion turns string literal into bool: %0 to %1
    • +
    • warning: implicit conversion turns vector to scalar: %0 to %1
    • +
    • warning: implicit conversion when assigning computation result loses floating-point precision: %0 to %1
    • +
    • warning: implicit truncation from %2 to a one-bit wide bit-field changes value from %0 to %1
    • +
    • warning: implicit truncation from %2 to bit-field changes value from %0 to %1
    • +
    • warning: incompatible integer to pointer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: incompatible pointer to integer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: initialization of pointer of type %0 to null from a constant boolean expression
    • +
    • warning: non-type template argument value '%0' truncated to '%1' for template parameter of type %2
    • +
    • warning: non-type template argument with value '%0' converted to '%1' for unsigned template parameter of type %2
    • +
    • warning: nonnull %select{function call|parameter}0 '%1' will evaluate to 'true' on first encounter
    • +
    • warning: object of type %0 is not compatible with %select{array element type|dictionary key type|dictionary value type}1 %2
    • +
    • warning: operand of ? changes signedness: %0 to %1
    • +
    • warning: passing non-generic address space pointer to %0 may cause dynamic conversion affecting performance
    • +
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    • warning: signed bit-field %0 needs an extra bit to represent the largest positive enumerators of %1
    • +
    • warning: the resulting value is always non-negative after implicit conversion

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-suggest-destructor-override - clang-diagnostic-suggest-destructor-override + clang-diagnostic-coro-non-aligned-allocation-function + clang-diagnostic-coro-non-aligned-allocation-function Diagnostic text:

      -
    • warning: %sub{warn_destructor_marked_not_override_overriding}0
    • +
    • warning: under -fcoro-aligned-allocation, the non-aligned allocation function for the promise type %0 has higher precedence than the global aligned allocation function

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++14-extensions - clang-diagnostic-c++14-extensions + clang-diagnostic-coroutine + clang-diagnostic-coroutine Diagnostic text:

      -
    • warning: 'decltype(auto)' type specifier is a C++14 extension
    • -
    • warning: binary integer literals are a C++14 extension
    • -
    • warning: initialized lambda captures are a C++14 extension
    • -
    • warning: multiple return statements in constexpr function is a C++14 extension
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is a C++14 extension
    • -
    • warning: use of the %0 attribute is a C++14 extension
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++14 extension
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is a C++14 extension
    • -
    • warning: variable templates are a C++14 extension
    • +
    • warning: %0 is required to declare the member 'unhandled_exception()' when exceptions are enabled
    • +
    • warning: 'for co_await' belongs to CoroutineTS instead of C++20, which is deprecated
    • +
    • warning: return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.
    • +
    • warning: this coroutine may be split into pieces; not every piece is guaranteed to be inlined
    • +
    • warning: under -fcoro-aligned-allocation, the non-aligned allocation function for the promise type %0 has higher precedence than the global aligned allocation function

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++14-attribute-extensions - clang-diagnostic-c++14-attribute-extensions + clang-diagnostic-coroutine-missing-unhandled-exception + clang-diagnostic-coroutine-missing-unhandled-exception Diagnostic text:

      -
    • warning: use of the %0 attribute is a C++14 extension
    • +
    • warning: %0 is required to declare the member 'unhandled_exception()' when exceptions are enabled

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++14-binary-literal - clang-diagnostic-c++14-binary-literal + clang-diagnostic-covered-switch-default + clang-diagnostic-covered-switch-default Diagnostic text:

      -
    • warning: binary integer literals are a C++14 extension
    • +
    • warning: default label in switch which covers all enumeration values

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++14-compat - clang-diagnostic-c++14-compat + clang-diagnostic-ctu + clang-diagnostic-ctu Diagnostic text:

      -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: imported AST from '%0' had been generated for a different target, current: %1, imported: %2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++14-compat-pedantic - clang-diagnostic-c++14-compat-pedantic + clang-diagnostic-cuda-compat + clang-diagnostic-cuda-compat Diagnostic text:

      -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: designated initializers are incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: %0 attribute parameter %1 is negative and will be ignored
    • +
    • warning: argument to '#pragma unroll' should not be in parentheses in CUDA C/C++
    • +
    • warning: ignored 'inline' attribute on kernel function %0
    • +
    • warning: kernel function %0 is a member function; this may not be accepted by nvcc
    • +
    • warning: nvcc does not allow '__%0__' to appear after the parameter list in lambdas

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++17-extensions - clang-diagnostic-c++17-extensions + clang-diagnostic-unknown-cuda-version + clang-diagnostic-unknown-cuda-version Diagnostic text:

      -
    • warning: '%select{if|switch}0' initialization statements are a C++17 extension
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is a C++17 extension
    • -
    • warning: 'constexpr' on lambda expressions is a C++17 extension
    • -
    • warning: 'static_assert' with no message is a C++17 extension
    • -
    • warning: ISO C++ standards before C++17 do not allow new expression for type %0 to use list-initialization
    • -
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are a C++17 extension
    • -
    • warning: capture of '*this' by copy is a C++17 extension
    • -
    • warning: constexpr if is a C++17 extension
    • -
    • warning: decomposition declarations are a C++17 extension
    • -
    • warning: default scope specifier for attributes is a C++17 extension
    • -
    • warning: hexadecimal floating literals are a C++17 feature
    • -
    • warning: inline variables are a C++17 extension
    • -
    • warning: nested namespace definition is a C++17 extension; define each namespace separately
    • -
    • warning: pack expansion of using declaration is a C++17 extension
    • -
    • warning: pack fold expression is a C++17 extension
    • -
    • warning: template template parameter using 'typename' is a C++17 extension
    • -
    • warning: use of multiple declarators in a single using declaration is a C++17 extension
    • -
    • warning: use of the %0 attribute is a C++17 extension
    • +
    • warning: CUDA version %0 is only partially supported
    • +
    • warning: CUDA version%0 is newer than the latest%select{| partially}1 supported version %2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++17-attribute-extensions - clang-diagnostic-c++17-attribute-extensions + clang-diagnostic-custom-atomic-properties + clang-diagnostic-custom-atomic-properties Diagnostic text:

      -
    • warning: use of the %0 attribute is a C++17 extension
    • +
    • warning: atomic by default property %0 has a user defined %select{getter|setter}1 (property should be marked 'atomic' if this is intended)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++17-compat - clang-diagnostic-c++17-compat + clang-diagnostic-dxil-validation + clang-diagnostic-dxil-validation Diagnostic text:

      -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: dxv not found. Resulting DXIL will not be validated or signed for use in release environments.

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++17-compat-mangling - clang-diagnostic-c++17-compat-mangling + clang-diagnostic-dangling + clang-diagnostic-dangling Diagnostic text:

      -
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • +
    • warning: %select{address of|reference to}0 stack memory associated with %select{local variable|parameter}2 %1 returned
    • +
    • warning: %select{reference|backing array for 'std::initializer_list'}2 %select{|subobject of }1member %0 %select{binds to|is}2 a temporary object whose lifetime is shorter than the lifetime of the constructed object
    • +
    • warning: %select{temporary %select{whose address is used as value of|%select{|implicitly }2bound to}4 %select{%select{|reference }4member of local variable|local %select{variable|reference}4}1|array backing %select{initializer list subobject of local variable|local initializer list}1}0 %select{%3 |}2will be destroyed at the end of the full-expression
    • +
    • warning: array backing %select{initializer list subobject of the allocated object|the allocated initializer list}0 will be destroyed at the end of the full-expression
    • +
    • warning: binding reference member %0 to stack allocated %select{variable|parameter}2 %1
    • +
    • warning: initializing pointer member %0 to point to a temporary object whose lifetime is shorter than the lifetime of the constructed object
    • +
    • warning: initializing pointer member %0 with the stack address of %select{variable|parameter}2 %1
    • +
    • warning: lifetime extension of %select{temporary|backing array of initializer list}0 created by aggregate initialization using a default member initializer is not yet supported; lifetime of %select{temporary|backing array}0 will end at the end of the full-expression
    • +
    • warning: object backing the pointer will be destroyed at the end of the full-expression
    • +
    • warning: returning %select{address of|reference to}0 local temporary object
    • +
    • warning: returning address of label, which is local
    • +
    • warning: temporary bound to reference member of allocated object will be destroyed at the end of the full-expression

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++17-compat-pedantic - clang-diagnostic-c++17-compat-pedantic + clang-diagnostic-dangling-else + clang-diagnostic-dangling-else Diagnostic text:

      -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: designated initializers are incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • -
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: add explicit braces to avoid dangling else

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++20-extensions - clang-diagnostic-c++20-extensions + clang-diagnostic-dangling-field + clang-diagnostic-dangling-field + + Diagnostic text:

    +
      +
    • warning: %select{reference|backing array for 'std::initializer_list'}2 %select{|subobject of }1member %0 %select{binds to|is}2 a temporary object whose lifetime is shorter than the lifetime of the constructed object
    • +
    • warning: binding reference member %0 to stack allocated %select{variable|parameter}2 %1
    • +
    • warning: initializing pointer member %0 with the stack address of %select{variable|parameter}2 %1
    • +
    • warning: temporary bound to reference member of allocated object will be destroyed at the end of the full-expression
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-dangling-gsl + clang-diagnostic-dangling-gsl + + Diagnostic text:

    +
      +
    • warning: initializing pointer member %0 to point to a temporary object whose lifetime is shorter than the lifetime of the constructed object
    • +
    • warning: object backing the pointer will be destroyed at the end of the full-expression
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-dangling-initializer-list + clang-diagnostic-dangling-initializer-list + + Diagnostic text:

    +
      +
    • warning: array backing %select{initializer list subobject of the allocated object|the allocated initializer list}0 will be destroyed at the end of the full-expression
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-dealloc-in-category + clang-diagnostic-dealloc-in-category + + Diagnostic text:

    +
      +
    • warning: -dealloc is being overridden in a category
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-declaration-after-statement + clang-diagnostic-declaration-after-statement + + Diagnostic text:

    +
      +
    • warning: mixing declarations and code is a C99 extension
    • +
    • warning: mixing declarations and code is incompatible with standards before C99
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-defaulted-function-deleted + clang-diagnostic-defaulted-function-deleted + + Diagnostic text:

    +
      +
    • warning: explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly deleted
    • +
    • warning: explicitly defaulted %sub{select_special_member_kind}0 is implicitly deleted
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-delegating-ctor-cycles + clang-diagnostic-delegating-ctor-cycles Diagnostic text:

      -
    • warning: constexpr constructor that does not initialize all members is a C++20 extension
    • -
    • warning: constexpr union constructor that does not initialize any member is a C++20 extension
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension
    • -
    • warning: default member initializer for bit-field is a C++20 extension
    • -
    • warning: defaulted comparison operators are a C++20 extension
    • -
    • warning: designated initializers are a C++20 extension
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is a C++20 extension
    • -
    • warning: explicit template parameter list for lambdas is a C++20 extension
    • -
    • warning: explicit(bool) is a C++20 extension
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is a C++20 extension
    • -
    • warning: initialized lambda pack captures are a C++20 extension
    • -
    • warning: inline nested namespace definition is a C++20 extension
    • -
    • warning: invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension
    • -
    • warning: range-based for loop initialization statements are a C++20 extension
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is a C++20 extension
    • -
    • warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension
    • -
    • warning: use of the %0 attribute is a C++20 extension
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++20 extension
    • -
    • warning: using declaration naming a scoped enumerator is a C++20 extension
    • -
    • warning: using enum declaration is a C++20 extension
    • +
    • warning: constructor for %0 creates a delegation cycle

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-c++20-attribute-extensions - clang-diagnostic-c++20-attribute-extensions + clang-diagnostic-delete-abstract-non-virtual-dtor + clang-diagnostic-delete-abstract-non-virtual-dtor Diagnostic text:

      -
    • warning: use of the %0 attribute is a C++20 extension
    • +
    • warning: %select{delete|destructor}0 called on %1 that is abstract but has non-virtual destructor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++20-compat - clang-diagnostic-c++20-compat + clang-diagnostic-delete-incomplete + clang-diagnostic-delete-incomplete Diagnostic text:

      -
    • warning: '%0' is a keyword in C++20
    • -
    • warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior
    • -
    • warning: 'consteval' specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'constinit' specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: aggregate initialization of type %0 with user-declared constructors is incompatible with C++20
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: this expression will be parsed as explicit(bool) in C++20
    • -
    • warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20
    • +
    • warning: cannot delete expression with pointer-to-'void' type %0
    • +
    • warning: deleting pointer to incomplete type %0 may cause undefined behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++20-compat-pedantic - clang-diagnostic-c++20-compat-pedantic + clang-diagnostic-delete-non-abstract-non-virtual-dtor + clang-diagnostic-delete-non-abstract-non-virtual-dtor Diagnostic text:

      -
    • warning: '%0' is a keyword in C++20
    • -
    • warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior
    • -
    • warning: 'consteval' specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'constinit' specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: aggregate initialization of type %0 with user-declared constructors is incompatible with C++20
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: this expression will be parsed as explicit(bool) in C++20
    • -
    • warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20
    • +
    • warning: %select{delete|destructor}0 called on non-final %1 that has virtual functions but non-virtual destructor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++20-designator - clang-diagnostic-c++20-designator + clang-diagnostic-delete-non-virtual-dtor + clang-diagnostic-delete-non-virtual-dtor Diagnostic text:

      -
    • warning: designated initializers are a C++20 extension
    • +
    • warning: %select{delete|destructor}0 called on %1 that is abstract but has non-virtual destructor
    • +
    • warning: %select{delete|destructor}0 called on non-final %1 that has virtual functions but non-virtual destructor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++2b-extensions - clang-diagnostic-c++2b-extensions + clang-diagnostic-deprecated + clang-diagnostic-deprecated Diagnostic text:

      -
    • warning: 'size_t' suffix for literals is a C++2b extension
    • -
    • warning: alias declaration in this context is a C++2b extension
    • -
    • warning: an attribute specifier sequence in this position is a C++2b extension
    • -
    • warning: consteval if is a C++2b extension
    • -
    • warning: lambda without a parameter clause is a C++2b extension
    • +
    • warning: %0 does not support the option '%1'
    • +
    • warning: %0 is deprecated
    • +
    • warning: %0 is deprecated: %1
    • +
    • warning: %0 may be deprecated because the receiver type is unknown
    • +
    • warning: %select{decrement|increment}0 of object of volatile-qualified type %1 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: '_ExtInt' is deprecated; use '_BitInt' instead
    • +
    • warning: 'depend' clause for 'ordered' is deprecated; use 'doacross' instead
    • +
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • +
    • warning: -O4 is equivalent to -O3
    • +
    • warning: Use of 'long' with '__vector' is deprecated
    • +
    • warning: access declarations are deprecated; use using declarations instead
    • +
    • warning: applying attribute %0 to a declaration is deprecated; apply it to the type instead
    • +
    • warning: argument '%0' is deprecated, %1
    • +
    • warning: argument '%0' is deprecated, use '%1' instead
    • +
    • warning: builtin %0 is deprecated; use %1 instead
    • +
    • warning: comparison between two arrays is deprecated; to compare array addresses, use unary '+' to decay operands to pointers
    • +
    • warning: conversion from string literal to %0 is deprecated
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared copy %select{assignment operator|constructor}1
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared destructor
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided copy %select{assignment operator|constructor}1
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided destructor
    • +
    • warning: dynamic exception specifications are deprecated
    • +
    • warning: identifier %0 preceded by whitespace in a literal operator declaration is deprecated
    • +
    • warning: implicit capture of 'this' with a capture default of '=' is deprecated
    • +
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • +
    • warning: macro %0 has been marked as deprecated%select{|: %2}1
    • +
    • warning: minus(-) operator for reductions is deprecated; use + or user defined reduction instead
    • +
    • warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated
    • +
    • warning: property access is using %0 method which is deprecated
    • +
    • warning: specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead
    • +
    • warning: specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead
    • +
    • warning: the '[[_Noreturn]]' attribute spelling is deprecated in C23; use '[[noreturn]]' instead
    • +
    • warning: top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++23
    • +
    • warning: treating '%0' input as '%1' when in C++ mode, this behavior is deprecated
    • +
    • warning: use of C-style parameters in Objective-C method declarations is deprecated
    • +
    • warning: use of result of assignment to object of volatile-qualified type %0 is deprecated
    • +
    • warning: volatile qualifier in structured binding declaration is deprecated
    • +
    • warning: volatile-qualified parameter type %0 is deprecated
    • +
    • warning: volatile-qualified return type %0 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++98-compat - clang-diagnostic-c++98-compat + clang-diagnostic-deprecated-anon-enum-enum-conversion + clang-diagnostic-deprecated-anon-enum-enum-conversion Diagnostic text:

      -
    • warning: %select{anonymous struct|union}0 member %1 with a non-trivial %sub{select_special_member_kind}2 is incompatible with C++98
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{defaulted|deleted}0 function definitions are incompatible with C++98
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: '%0' keyword is incompatible with C++98
    • -
    • warning: '%0' type specifier is incompatible with C++98
    • -
    • warning: '<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'alignas' is incompatible with C++98
    • -
    • warning: 'auto' type specifier is incompatible with C++98
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'constexpr' specifier is incompatible with C++98
    • -
    • warning: 'decltype' type specifier is incompatible with C++98
    • -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: 'nullptr' is incompatible with C++98
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: C++11 attribute syntax is incompatible with C++98
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: alias declarations are incompatible with C++98
    • -
    • warning: alignof expressions are incompatible with C++98
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: befriending %1 without '%select{struct|interface|union|class|enum}0' keyword is incompatible with C++98
    • -
    • warning: befriending enumeration type %0 is incompatible with C++98
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: consecutive right angle brackets are incompatible with C++98 (use '> >')
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: constructor call from initializer list is incompatible with C++98
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for non-static data members is incompatible with C++98
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: default template arguments for a function template are incompatible with C++98
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: delegating constructors are incompatible with C++98
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: enumeration type in nested name specifier is incompatible with C++98
    • -
    • warning: enumeration types with a fixed underlying type are incompatible with C++98
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit conversion functions are incompatible with C++98
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: friend declaration naming a member of the declaring class is incompatible with C++98
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: generalized initializer lists are incompatible with C++98
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: inheriting constructors are incompatible with C++98
    • -
    • warning: initialization of initializer_list object is incompatible with C++98
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: initializing %0 from an empty initializer list is incompatible with C++98
    • -
    • warning: inline namespaces are incompatible with C++98
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: jump from switch statement to this case label is incompatible with C++98
    • -
    • warning: jump from this %select{indirect|asm}0 goto statement to one of its possible targets is incompatible with C++98
    • -
    • warning: jump from this goto statement to its label is incompatible with C++98
    • -
    • warning: lambda expressions are incompatible with C++98
    • -
    • warning: literal operators are incompatible with C++98
    • -
    • warning: local type %0 as template argument is incompatible with C++98
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: noexcept expressions are incompatible with C++98
    • -
    • warning: noexcept specifications are incompatible with C++98
    • -
    • warning: non-class friend type %0 is incompatible with C++98
    • -
    • warning: non-type template argument referring to %select{function|object}0 %1 with internal linkage is incompatible with C++98
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: passing object of trivial but non-POD type %0 through variadic %select{function|block|method|constructor}1 is incompatible with C++98
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop is incompatible with C++98
    • -
    • warning: raw string literals are incompatible with C++98
    • -
    • warning: redundant parentheses surrounding address non-type template argument are incompatible with C++98
    • -
    • warning: reference initialized from initializer list is incompatible with C++98
    • -
    • warning: reference qualifiers on functions are incompatible with C++98
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: rvalue references are incompatible with C++98
    • -
    • warning: scalar initialized from empty initializer list is incompatible with C++98
    • -
    • warning: scoped enumerations are incompatible with C++98
    • -
    • warning: specifying character '%0' with a universal character name is incompatible with C++98
    • -
    • warning: static data member %0 in union is incompatible with C++98
    • -
    • warning: static_assert declarations are incompatible with C++98
    • -
    • warning: substitution failure due to access control is incompatible with C++98
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: trailing return types are incompatible with C++98
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++98
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: universal character name referring to a control character is incompatible with C++98
    • -
    • warning: unnamed type as template argument is incompatible with C++98
    • -
    • warning: use of 'template' keyword outside of a template is incompatible with C++98
    • -
    • warning: use of 'typename' outside of a template is incompatible with C++98
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of non-static data member %0 in an unevaluated context is incompatible with C++98
    • -
    • warning: use of null pointer as non-type template argument is incompatible with C++98
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • -
    • warning: variadic templates are incompatible with C++98
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-array-compare + clang-diagnostic-deprecated-array-compare + + Diagnostic text:

    +
      +
    • warning: comparison between two arrays is deprecated; to compare array addresses, use unary '+' to decay operands to pointers

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++98-compat-bind-to-temporary-copy - clang-diagnostic-c++98-compat-bind-to-temporary-copy + clang-diagnostic-deprecated-attributes + clang-diagnostic-deprecated-attributes Diagnostic text:

      -
    • warning: %sub{select_initialized_entity_kind}1 of type %2 when binding a reference to a temporary would %select{invoke an inaccessible constructor|find no viable constructor|find ambiguous constructors|invoke a deleted constructor}0 in C++98
    • +
    • warning: applying attribute %0 to a declaration is deprecated; apply it to the type instead
    • +
    • warning: specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead
    • +
    • warning: the '[[_Noreturn]]' attribute spelling is deprecated in C23; use '[[noreturn]]' instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++98-compat-extra-semi - clang-diagnostic-c++98-compat-extra-semi + clang-diagnostic-deprecated-builtins + clang-diagnostic-deprecated-builtins Diagnostic text:

      -
    • warning: extra ';' outside of a function is incompatible with C++98
    • +
    • warning: builtin %0 is deprecated; use %1 instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++98-compat-local-type-template-args - clang-diagnostic-c++98-compat-local-type-template-args + clang-diagnostic-deprecated-comma-subscript + clang-diagnostic-deprecated-comma-subscript Diagnostic text:

      -
    • warning: local type %0 as template argument is incompatible with C++98
    • +
    • warning: top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++23

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++98-compat-pedantic - clang-diagnostic-c++98-compat-pedantic + clang-diagnostic-deprecated-copy + clang-diagnostic-deprecated-copy Diagnostic text:

      -
    • warning: #line number greater than 32767 is incompatible with C++98
    • -
    • warning: %select{anonymous struct|union}0 member %1 with a non-trivial %sub{select_special_member_kind}2 is incompatible with C++98
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{defaulted|deleted}0 function definitions are incompatible with C++98
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: %sub{select_initialized_entity_kind}1 of type %2 when binding a reference to a temporary would %select{invoke an inaccessible constructor|find no viable constructor|find ambiguous constructors|invoke a deleted constructor}0 in C++98
    • -
    • warning: '%0' keyword is incompatible with C++98
    • -
    • warning: '%0' type specifier is incompatible with C++98
    • -
    • warning: '<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'alignas' is incompatible with C++98
    • -
    • warning: 'auto' type specifier is incompatible with C++98
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'constexpr' specifier is incompatible with C++98
    • -
    • warning: 'decltype' type specifier is incompatible with C++98
    • -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: 'long long' is incompatible with C++98
    • -
    • warning: 'nullptr' is incompatible with C++98
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: C++11 attribute syntax is incompatible with C++98
    • -
    • warning: C++98 requires newline at end of file
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: alias declarations are incompatible with C++98
    • -
    • warning: alignof expressions are incompatible with C++98
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
    • -
    • warning: befriending %1 without '%select{struct|interface|union|class|enum}0' keyword is incompatible with C++98
    • -
    • warning: befriending enumeration type %0 is incompatible with C++98
    • -
    • warning: binary integer literals are incompatible with C++ standards before C++14
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: cast between pointer-to-function and pointer-to-object is incompatible with C++98
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: commas at the end of enumerator lists are incompatible with C++98
    • -
    • warning: consecutive right angle brackets are incompatible with C++98 (use '> >')
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: constructor call from initializer list is incompatible with C++98
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for non-static data members is incompatible with C++98
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: default template arguments for a function template are incompatible with C++98
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: delegating constructors are incompatible with C++98
    • -
    • warning: designated initializers are incompatible with C++ standards before C++20
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: empty macro arguments are incompatible with C++98
    • -
    • warning: enumeration type in nested name specifier is incompatible with C++98
    • -
    • warning: enumeration types with a fixed underlying type are incompatible with C++98
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit conversion functions are incompatible with C++98
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: extern templates are incompatible with C++98
    • -
    • warning: extra ';' outside of a function is incompatible with C++98
    • -
    • warning: friend declaration naming a member of the declaring class is incompatible with C++98
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: generalized initializer lists are incompatible with C++98
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
    • -
    • warning: implicit conversion from array size expression of type %0 to %select{integral|enumeration}1 type %2 is incompatible with C++98
    • -
    • warning: inheriting constructors are incompatible with C++98
    • -
    • warning: initialization of initializer_list object is incompatible with C++98
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: initializing %0 from an empty initializer list is incompatible with C++98
    • -
    • warning: inline namespaces are incompatible with C++98
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • -
    • warning: jump from switch statement to this case label is incompatible with C++98
    • -
    • warning: jump from this %select{indirect|asm}0 goto statement to one of its possible targets is incompatible with C++98
    • -
    • warning: jump from this goto statement to its label is incompatible with C++98
    • -
    • warning: lambda expressions are incompatible with C++98
    • -
    • warning: literal operators are incompatible with C++98
    • -
    • warning: local type %0 as template argument is incompatible with C++98
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: noexcept expressions are incompatible with C++98
    • -
    • warning: noexcept specifications are incompatible with C++98
    • -
    • warning: non-class friend type %0 is incompatible with C++98
    • -
    • warning: non-type template argument referring to %select{function|object}0 %1 with internal linkage is incompatible with C++98
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: passing object of trivial but non-POD type %0 through variadic %select{function|block|method|constructor}1 is incompatible with C++98
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop is incompatible with C++98
    • -
    • warning: raw string literals are incompatible with C++98
    • -
    • warning: redundant parentheses surrounding address non-type template argument are incompatible with C++98
    • -
    • warning: reference initialized from initializer list is incompatible with C++98
    • -
    • warning: reference qualifiers on functions are incompatible with C++98
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: rvalue references are incompatible with C++98
    • -
    • warning: scalar initialized from empty initializer list is incompatible with C++98
    • -
    • warning: scoped enumerations are incompatible with C++98
    • -
    • warning: specifying character '%0' with a universal character name is incompatible with C++98
    • -
    • warning: static data member %0 in union is incompatible with C++98
    • -
    • warning: static_assert declarations are incompatible with C++98
    • -
    • warning: substitution failure due to access control is incompatible with C++98
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: trailing return types are incompatible with C++98
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++98
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: universal character name referring to a control character is incompatible with C++98
    • -
    • warning: unnamed type as template argument is incompatible with C++98
    • -
    • warning: use of 'template' keyword outside of a template is incompatible with C++98
    • -
    • warning: use of 'typename' outside of a template is incompatible with C++98
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of non-static data member %0 in an unevaluated context is incompatible with C++98
    • -
    • warning: use of null pointer as non-type template argument is incompatible with C++98
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • -
    • warning: variadic macros are incompatible with C++98
    • -
    • warning: variadic templates are incompatible with C++98
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared copy %select{assignment operator|constructor}1
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided copy %select{assignment operator|constructor}1
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-copy-with-dtor + clang-diagnostic-deprecated-copy-with-dtor + + Diagnostic text:

    +
      +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared destructor
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided destructor
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-copy-with-user-provided-copy + clang-diagnostic-deprecated-copy-with-user-provided-copy + + Diagnostic text:

    +
      +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided copy %select{assignment operator|constructor}1
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-copy-with-user-provided-dtor + clang-diagnostic-deprecated-copy-with-user-provided-dtor + + Diagnostic text:

    +
      +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided destructor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++98-compat-unnamed-type-template-args - clang-diagnostic-c++98-compat-unnamed-type-template-args + clang-diagnostic-deprecated-coroutine + clang-diagnostic-deprecated-coroutine Diagnostic text:

      -
    • warning: unnamed type as template argument is incompatible with C++98
    • +
    • warning: 'for co_await' belongs to CoroutineTS instead of C++20, which is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++-compat - clang-diagnostic-c++-compat + clang-diagnostic-deprecated-declarations + clang-diagnostic-deprecated-declarations Diagnostic text:

      -
    • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++
    • +
    • warning: %0 is deprecated
    • +
    • warning: %0 is deprecated: %1
    • +
    • warning: %0 may be deprecated because the receiver type is unknown
    • +
    • warning: property access is using %0 method which is deprecated
    • +
    • warning: specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead
    • +
    • warning: use of C-style parameters in Objective-C method declarations is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c++14-compat - clang-diagnostic-pre-c++14-compat + clang-diagnostic-deprecated-dynamic-exception-spec + clang-diagnostic-deprecated-dynamic-exception-spec Diagnostic text:

      -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • +
    • warning: dynamic exception specifications are deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++98-c++11-compat-binary-literal - clang-diagnostic-c++98-c++11-compat-binary-literal + clang-diagnostic-deprecated-enum-compare + clang-diagnostic-deprecated-enum-compare Diagnostic text:

      -
    • warning: binary integer literals are incompatible with C++ standards before C++14
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c++14-compat-pedantic - clang-diagnostic-pre-c++14-compat-pedantic + clang-diagnostic-deprecated-enum-compare-conditional + clang-diagnostic-deprecated-enum-compare-conditional Diagnostic text:

      -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: binary integer literals are incompatible with C++ standards before C++14
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c++17-compat - clang-diagnostic-pre-c++17-compat + clang-diagnostic-deprecated-enum-enum-conversion + clang-diagnostic-deprecated-enum-enum-conversion Diagnostic text:

      -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c++17-compat-pedantic - clang-diagnostic-pre-c++17-compat-pedantic + clang-diagnostic-deprecated-enum-float-conversion + clang-diagnostic-deprecated-enum-float-conversion Diagnostic text:

      -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c++20-compat - clang-diagnostic-pre-c++20-compat + clang-diagnostic-deprecated-experimental-coroutine + clang-diagnostic-deprecated-experimental-coroutine Diagnostic text:

      -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: support for std::experimental::%0 will be removed in LLVM 15; use std::%0 instead
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-implementations + clang-diagnostic-deprecated-implementations + + Diagnostic text:

    +
      +
    • warning: implementing deprecated %select{method|class|category}0
    • +
    • warning: implementing unavailable method
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-increment-bool + clang-diagnostic-deprecated-increment-bool + + Diagnostic text:

    +
      +
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-literal-operator + clang-diagnostic-deprecated-literal-operator + + Diagnostic text:

    +
      +
    • warning: identifier %0 preceded by whitespace in a literal operator declaration is deprecated
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-module-dot-map + clang-diagnostic-deprecated-module-dot-map + + Diagnostic text:

    +
      +
    • warning: '%0' as a module map name is deprecated, rename it to %select{module.modulemap|module.private.modulemap}1%select{| in the 'Modules' directory of the framework}2
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-non-prototype + clang-diagnostic-deprecated-non-prototype + + Diagnostic text:

    +
      +
    • warning: a function %select{declaration|definition}0 without a prototype is deprecated in all versions of C %select{and is not supported in C23|and is treated as a zero-parameter prototype in C23, conflicting with a %select{previous|subsequent}2 %select{declaration|definition}3}1
    • +
    • warning: passing arguments to %select{a function|%1}0 without a prototype is deprecated in all versions of C and is not supported in C23
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-objc-isa-usage + clang-diagnostic-deprecated-objc-isa-usage + + Diagnostic text:

    +
      +
    • warning: assignment to Objective-C's isa is deprecated in favor of object_setClass()
    • +
    • warning: direct access to Objective-C's isa is deprecated in favor of object_getClass()
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-pragma + clang-diagnostic-deprecated-pragma + + Diagnostic text:

    +
      +
    • warning: macro %0 has been marked as deprecated%select{|: %2}1
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-redundant-constexpr-static-def + clang-diagnostic-deprecated-redundant-constexpr-static-def + + Diagnostic text:

    +
      +
    • warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-register + clang-diagnostic-deprecated-register + + Diagnostic text:

    +
      +
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c++20-compat-pedantic - clang-diagnostic-pre-c++20-compat-pedantic + clang-diagnostic-deprecated-static-analyzer-flag + clang-diagnostic-deprecated-static-analyzer-flag Diagnostic text:

      -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: designated initializers are incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    • warning: analyzer option '%0' is deprecated. This flag will be removed in %1, and passing this option will be an error.
    • +
    • warning: analyzer option '%0' is deprecated. This flag will be removed in %1, and passing this option will be an error. Use '%2' instead.

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c++2b-compat - clang-diagnostic-pre-c++2b-compat + clang-diagnostic-deprecated-this-capture + clang-diagnostic-deprecated-this-capture Diagnostic text:

      -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • +
    • warning: implicit capture of 'this' with a capture default of '=' is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-c++2b-compat-pedantic - clang-diagnostic-pre-c++2b-compat-pedantic + clang-diagnostic-deprecated-type + clang-diagnostic-deprecated-type Diagnostic text:

      -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • +
    • warning: '_ExtInt' is deprecated; use '_BitInt' instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-called-once-parameter - clang-diagnostic-called-once-parameter + clang-diagnostic-deprecated-volatile + clang-diagnostic-deprecated-volatile Diagnostic text:

      -
    • warning: %0 parameter marked 'called_once' is called twice
    • -
    • warning: %0 parameter marked 'called_once' is never %select{used|called}1 when %select{taking true branch|taking false branch|handling this case|none of the cases applies|entering the loop|skipping the loop|taking one of the branches}2
    • -
    • warning: %select{|captured }1%0 parameter marked 'called_once' is never called
    • -
    • warning: %select{|captured }1completion handler is never called
    • -
    • warning: completion handler is called twice
    • -
    • warning: completion handler is never %select{used|called}1 when %select{taking true branch|taking false branch|handling this case|none of the cases applies|entering the loop|skipping the loop|taking one of the branches}2
    • +
    • warning: %select{decrement|increment}0 of object of volatile-qualified type %1 is deprecated
    • +
    • warning: use of result of assignment to object of volatile-qualified type %0 is deprecated
    • +
    • warning: volatile qualifier in structured binding declaration is deprecated
    • +
    • warning: volatile-qualified parameter type %0 is deprecated
    • +
    • warning: volatile-qualified return type %0 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-cast-align - clang-diagnostic-cast-align + clang-diagnostic-deprecated-writable-strings + clang-diagnostic-deprecated-writable-strings Diagnostic text:

      -
    • warning: cast from %0 to %1 increases required alignment from %2 to %3
    • +
    • warning: conversion from string literal to %0 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-cast-function-type - clang-diagnostic-cast-function-type + clang-diagnostic-distributed-object-modifiers + clang-diagnostic-distributed-object-modifiers Diagnostic text:

      -
    • warning: cast %diff{from $ to $ |}0,1converts to incompatible function type
    • +
    • warning: conflicting distributed object modifiers on parameter type in implementation of %0
    • +
    • warning: conflicting distributed object modifiers on return type in implementation of %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-cast-qual - clang-diagnostic-cast-qual + clang-diagnostic-division-by-zero + clang-diagnostic-division-by-zero Diagnostic text:

      -
    • warning: cast from %0 to %1 drops %select{const and volatile qualifiers|const qualifier|volatile qualifier}2
    • -
    • warning: cast from %0 to %1 must have all intermediate pointers const qualified to be safe
    • +
    • warning: %select{remainder|division}0 by zero is undefined

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-char-subscripts - clang-diagnostic-char-subscripts + clang-diagnostic-dllexport-explicit-instantiation-decl + clang-diagnostic-dllexport-explicit-instantiation-decl Diagnostic text:

      -
    • warning: array section %select{lower bound|length}0 is of type 'char'
    • -
    • warning: array subscript is of type 'char'
    • +
    • warning: explicit instantiation declaration should not be 'dllexport'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-clang-cl-pch - clang-diagnostic-clang-cl-pch + clang-diagnostic-documentation + clang-diagnostic-documentation Diagnostic text:

      -
    • warning: #pragma hdrstop filename not supported, /Fp can be used to specify precompiled header filename
    • -
    • warning: definition of macro %0 does not match definition in precompiled header
    • -
    • warning: support for '/Yc' and '/Yu' with different filenames not implemented yet; flags ignored
    • -
    • warning: support for '/Yc' with more than one source file not implemented yet; flag ignored
    • +
    • warning: '%select{\|@}0%1' command does not terminate a verbatim text block
    • +
    • warning: '%select{\|@}0%1' command has %plural{0:no|:%2}2 word argument%s2, expected %3
    • +
    • warning: '%select{\|@}0%1' command used in a comment that is attached to a %select{function returning void|constructor|destructor|method returning void}2
    • +
    • warning: '%select{\|@}0%1' command used in a comment that is not attached to a function or method declaration
    • +
    • warning: '%select{\|@}0%select{classdesign|coclass|dependency|helper|helperclass|helps|instancesize|ownership|performance|security|superclass}1' command should not be used in a comment attached to a non-container declaration
    • +
    • warning: '%select{\|@}0%select{class|interface|protocol|struct|union}1' command should not be used in a comment attached to a non-%select{class|interface|protocol|struct|union}2 declaration
    • +
    • warning: '%select{\|@}0%select{function|functiongroup|method|methodgroup|callback}1' command should be used in a comment attached to %select{a function|a function|an Objective-C method|an Objective-C method|a pointer to function}2 declaration
    • +
    • warning: '%select{\|@}0param' command used in a comment that is not attached to a function declaration
    • +
    • warning: '%select{\|@}0tparam' command used in a comment that is not attached to a template declaration
    • +
    • warning: HTML end tag '%0' is forbidden
    • +
    • warning: HTML end tag does not match any start tag
    • +
    • warning: HTML start tag '%0' closed by '%1'
    • +
    • warning: HTML start tag prematurely ended, expected attribute name or '>'
    • +
    • warning: HTML tag '%0' requires an end tag
    • +
    • warning: declaration is marked with '%select{\|@}0deprecated' command but does not have a deprecation attribute
    • +
    • warning: duplicated command '%select{\|@}0%1'
    • +
    • warning: empty paragraph passed to '%select{\|@}0%1' command
    • +
    • warning: expected quoted string after equals sign
    • +
    • warning: line splicing in Doxygen comments are not supported
    • +
    • warning: not a Doxygen trailing comment
    • +
    • warning: parameter '%0' is already documented
    • +
    • warning: parameter '%0' not found in the function declaration
    • +
    • warning: template parameter '%0' is already documented
    • +
    • warning: template parameter '%0' not found in the template declaration
    • +
    • warning: unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-class-conversion - clang-diagnostic-class-conversion + clang-diagnostic-documentation-deprecated-sync + clang-diagnostic-documentation-deprecated-sync Diagnostic text:

      -
    • warning: conversion function converting %0 to %1 will never be used
    • -
    • warning: conversion function converting %0 to its base class %1 will never be used
    • -
    • warning: conversion function converting %0 to itself will never be used
    • +
    • warning: declaration is marked with '%select{\|@}0deprecated' command but does not have a deprecation attribute

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-class-varargs - clang-diagnostic-class-varargs + clang-diagnostic-documentation-html + clang-diagnostic-documentation-html Diagnostic text:

      -
    • warning: cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic %select{function|block|method|constructor}2; expected type from format string was %3
    • -
    • warning: cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic %select{function|block|method|constructor}2; call will abort at runtime
    • -
    • warning: passing object of class type %0 through variadic %select{function|block|method|constructor}1%select{|; did you mean to call '%3'?}2
    • -
    • warning: second argument to 'va_arg' is of ARC ownership-qualified type %0
    • -
    • warning: second argument to 'va_arg' is of non-POD type %0
    • +
    • warning: HTML end tag '%0' is forbidden
    • +
    • warning: HTML end tag does not match any start tag
    • +
    • warning: HTML start tag '%0' closed by '%1'
    • +
    • warning: HTML tag '%0' requires an end tag

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-comment - clang-diagnostic-comment + clang-diagnostic-documentation-pedantic + clang-diagnostic-documentation-pedantic Diagnostic text:

      -
    • warning: '/*' within block comment
    • -
    • warning: // comments are not allowed in this language
    • -
    • warning: escaped newline between */ characters at block comment end
    • -
    • warning: multi-line // comment
    • +
    • warning: unknown command tag name
    • +
    • warning: unknown command tag name '%0'; did you mean '%1'?
    • +
    • warning: whitespace is not allowed in parameter passing direction

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-compare-distinct-pointer-types - clang-diagnostic-compare-distinct-pointer-types + clang-diagnostic-documentation-unknown-command + clang-diagnostic-documentation-unknown-command Diagnostic text:

      -
    • warning: comparison of distinct pointer types%diff{ ($ and $)|}0,1
    • +
    • warning: unknown command tag name
    • +
    • warning: unknown command tag name '%0'; did you mean '%1'?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-completion-handler - clang-diagnostic-completion-handler + clang-diagnostic-double-promotion + clang-diagnostic-double-promotion Diagnostic text:

      -
    • warning: %select{|captured }1completion handler is never called
    • -
    • warning: completion handler is called twice
    • -
    • warning: completion handler is never %select{used|called}1 when %select{taking true branch|taking false branch|handling this case|none of the cases applies|entering the loop|skipping the loop|taking one of the branches}2
    • +
    • warning: implicit conversion increases floating-point precision: %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-compound-token-split - clang-diagnostic-compound-token-split + clang-diagnostic-dtor-name + clang-diagnostic-dtor-name Diagnostic text:

      -
    • warning: %sub{subst_compound_token_kind}0,1,2,3 appear in different macro expansion contexts
    • -
    • warning: %sub{subst_compound_token_kind}0,1,2,3 are separated by whitespace
    • +
    • warning: ISO C++ considers this destructor name lookup to be ambiguous
    • +
    • warning: ISO C++ requires the name after '::~' to be found in the same scope as the name before '::~'
    • +
    • warning: qualified destructor name only found in lexical scope; omit the qualifier to find this type name by unqualified lookup

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-compound-token-split-by-macro - clang-diagnostic-compound-token-split-by-macro + clang-diagnostic-duplicate-method-arg + clang-diagnostic-duplicate-method-arg Diagnostic text:

      -
    • warning: %sub{subst_compound_token_kind}0,1,2,3 appear in different macro expansion contexts
    • +
    • warning: redeclaration of method parameter %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-compound-token-split-by-space - clang-diagnostic-compound-token-split-by-space + clang-diagnostic-duplicate-decl-specifier + clang-diagnostic-duplicate-decl-specifier Diagnostic text:

      -
    • warning: %sub{subst_compound_token_kind}0,1,2,3 are separated by whitespace
    • +
    • warning: %sub{duplicate_declspec}0
    • +
    • warning: %sub{duplicate_declspec}0
    • +
    • warning: %sub{duplicate_declspec}0
    • +
    • warning: multiple identical address spaces specified for type

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-config-macros - clang-diagnostic-config-macros + clang-diagnostic-dynamic-class-memaccess + clang-diagnostic-dynamic-class-memaccess Diagnostic text:

      -
    • warning: %select{definition|#undef}0 of configuration macro '%1' has no effect on the import of '%2'; pass '%select{-D%1=...|-U%1}0' on the command line to configure the module
    • +
    • warning: %select{destination for|source of|first operand of|second operand of}0 this %1 call is a pointer to %select{|class containing a }2dynamic class %3; vtable pointer will be %select{overwritten|copied|moved|compared}4

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-constant-conversion - clang-diagnostic-constant-conversion + clang-diagnostic-dynamic-exception-spec + clang-diagnostic-dynamic-exception-spec Diagnostic text:

      -
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • -
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • -
    • warning: implicit truncation from %2 to bit-field changes value from %0 to %1
    • +
    • warning: ISO C++17 does not allow dynamic exception specifications
    • +
    • warning: dynamic exception specifications are deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-consumed - clang-diagnostic-consumed + clang-diagnostic-empty-body + clang-diagnostic-empty-body Diagnostic text:

      -
    • warning: argument not in expected state; expected '%0', observed '%1'
    • -
    • warning: consumed analysis attribute is attached to member of class %0 which isn't marked as consumable
    • -
    • warning: invalid invocation of method '%0' on a temporary object while it is in the '%1' state
    • -
    • warning: invalid invocation of method '%0' on object '%1' while it is in the '%2' state
    • -
    • warning: parameter '%0' not in expected state when the function returns: expected '%1', observed '%2'
    • -
    • warning: return state set for an unconsumable type '%0'
    • -
    • warning: return value not in expected state; expected '%0', observed '%1'
    • -
    • warning: state of variable '%0' must match at the entry and exit of loop
    • +
    • warning: for loop has empty body
    • +
    • warning: if statement has empty body
    • +
    • warning: range-based for loop has empty body
    • +
    • warning: switch statement has empty body
    • +
    • warning: while loop has empty body

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-conversion - clang-diagnostic-conversion + clang-diagnostic-empty-init-stmt + clang-diagnostic-empty-init-stmt Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3
    • -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
    • -
    • warning: address of%select{| function| array}0 '%1' will always evaluate to 'true'
    • -
    • warning: assigning value of signed enum type %1 to unsigned bit-field %0; negative enumerators of enum %1 will be converted to positive values
    • -
    • warning: bit-field %0 is not wide enough to store all enumerators of %1
    • -
    • warning: expression which evaluates to zero treated as a null pointer constant of type %0
    • -
    • warning: higher order bits are zeroes after implicit conversion
    • -
    • warning: implicit boolean conversion of Objective-C object literal always evaluates to true
    • -
    • warning: implicit conversion changes signedness: %0 to %1
    • -
    • warning: implicit conversion discards imaginary component: %0 to %1
    • -
    • warning: implicit conversion from %0 to %1 changes non-zero value from %2 to %3
    • -
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • -
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • -
    • warning: implicit conversion from %0 to %1 may lose precision
    • -
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • -
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • -
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • -
    • warning: implicit conversion from enumeration type %0 to different enumeration type %1
    • -
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • -
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • -
    • warning: implicit conversion loses floating-point precision: %0 to %1
    • -
    • warning: implicit conversion loses integer precision: %0 to %1
    • -
    • warning: implicit conversion loses integer precision: %0 to %1
    • -
    • warning: implicit conversion of %select{NULL|nullptr}0 constant to %1
    • -
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • -
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • -
    • warning: implicit conversion turns floating-point number into integer: %0 to %1
    • -
    • warning: implicit conversion turns string literal into bool: %0 to %1
    • -
    • warning: implicit conversion turns vector to scalar: %0 to %1
    • -
    • warning: implicit conversion when assigning computation result loses floating-point precision: %0 to %1
    • -
    • warning: implicit truncation from %2 to bit-field changes value from %0 to %1
    • -
    • warning: incompatible integer to pointer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • -
    • warning: incompatible pointer to integer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • -
    • warning: initialization of pointer of type %0 to null from a constant boolean expression
    • -
    • warning: non-type template argument value '%0' truncated to '%1' for template parameter of type %2
    • -
    • warning: non-type template argument with value '%0' converted to '%1' for unsigned template parameter of type %2
    • -
    • warning: nonnull %select{function call|parameter}0 '%1' will evaluate to 'true' on first encounter
    • -
    • warning: object of type %0 is not compatible with %select{array element type|dictionary key type|dictionary value type}1 %2
    • -
    • warning: operand of ? changes signedness: %0 to %1
    • -
    • warning: passing non-generic address space pointer to %0 may cause dynamic conversion affecting performance
    • -
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true
    • -
    • warning: signed bit-field %0 needs an extra bit to represent the largest positive enumerators of %1
    • -
    • warning: the resulting value is always non-negative after implicit conversion
    • +
    • warning: empty initialization statement of '%select{if|switch|range-based for}0' has no effect

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-coroutine - clang-diagnostic-coroutine + clang-diagnostic-enum-compare + clang-diagnostic-enum-compare Diagnostic text:

      -
    • warning: %0 is required to declare the member 'unhandled_exception()' when exceptions are enabled
    • -
    • warning: 'for co_await' belongs to CoroutineTS instead of C++20, which is deprecated
    • -
    • warning: return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.
    • -
    • warning: support for std::experimental::%0 will be removed in LLVM 15; use std::%0 instead
    • -
    • warning: this coroutine may be split into pieces; not every piece is guaranteed to be inlined
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: comparison of different enumeration types in switch statement%diff{ ($ and $)|}0,1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-coroutine-missing-unhandled-exception - clang-diagnostic-coroutine-missing-unhandled-exception + clang-diagnostic-enum-compare-conditional + clang-diagnostic-enum-compare-conditional Diagnostic text:

      -
    • warning: %0 is required to declare the member 'unhandled_exception()' when exceptions are enabled
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-covered-switch-default - clang-diagnostic-covered-switch-default + clang-diagnostic-enum-compare-switch + clang-diagnostic-enum-compare-switch Diagnostic text:

      -
    • warning: default label in switch which covers all enumeration values
    • +
    • warning: comparison of different enumeration types in switch statement%diff{ ($ and $)|}0,1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ctu - clang-diagnostic-ctu + clang-diagnostic-enum-conversion + clang-diagnostic-enum-conversion Diagnostic text:

      -
    • warning: imported AST from '%0' had been generated for a different target, current: %1, imported: %2
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: implicit conversion from enumeration type %0 to different enumeration type %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-cuda-compat - clang-diagnostic-cuda-compat + clang-diagnostic-enum-enum-conversion + clang-diagnostic-enum-enum-conversion Diagnostic text:

      -
    • warning: %0 attribute parameter %1 is negative and will be ignored
    • -
    • warning: argument to '#pragma unroll' should not be in parentheses in CUDA C/C++
    • -
    • warning: ignored 'inline' attribute on kernel function %0
    • -
    • warning: kernel function %0 is a member function; this may not be accepted by nvcc
    • -
    • warning: nvcc does not allow '__%0__' to appear after the parameter list in lambdas
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unknown-cuda-version - clang-diagnostic-unknown-cuda-version + clang-diagnostic-enum-float-conversion + clang-diagnostic-enum-float-conversion Diagnostic text:

      -
    • warning: CUDA version %0 is only partially supported
    • -
    • warning: CUDA version%0 is newer than the latest%select{| partially}1 supported version %2
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-custom-atomic-properties - clang-diagnostic-custom-atomic-properties + clang-diagnostic-enum-too-large + clang-diagnostic-enum-too-large Diagnostic text:

      -
    • warning: atomic by default property %0 has a user defined %select{getter|setter}1 (property should be marked 'atomic' if this is intended)
    • +
    • warning: enumeration values exceed range of largest integer
    • +
    • warning: incremented enumerator value %0 is not representable in the largest integer type

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dangling - clang-diagnostic-dangling + clang-diagnostic-exceptions + clang-diagnostic-exceptions Diagnostic text:

      -
    • warning: %select{address of|reference to}0 stack memory associated with %select{local variable|parameter}2 %1 returned
    • -
    • warning: %select{reference|backing array for 'std::initializer_list'}2 %select{|subobject of }1member %0 %select{binds to|is}2 a temporary object whose lifetime is shorter than the lifetime of the constructed object
    • -
    • warning: %select{temporary %select{whose address is used as value of|%select{|implicitly }2bound to}4 %select{%select{|reference }4member of local variable|local %select{variable|reference}4}1|array backing %select{initializer list subobject of local variable|local initializer list}1}0 %select{%3 |}2will be destroyed at the end of the full-expression
    • -
    • warning: array backing %select{initializer list subobject of the allocated object|the allocated initializer list}0 will be destroyed at the end of the full-expression
    • -
    • warning: binding reference member %0 to stack allocated %select{variable|parameter}2 %1
    • -
    • warning: initializing pointer member %0 to point to a temporary object whose lifetime is shorter than the lifetime of the constructed object
    • -
    • warning: initializing pointer member %0 with the stack address of %select{variable|parameter}2 %1
    • -
    • warning: object backing the pointer will be destroyed at the end of the full-expression
    • -
    • warning: returning %select{address of|reference to}0 local temporary object
    • -
    • warning: returning address of label, which is local
    • -
    • warning: sorry, lifetime extension of %select{temporary|backing array of initializer list}0 created by aggregate initialization using default member initializer is not supported; lifetime of %select{temporary|backing array}0 will end at the end of the full-expression
    • -
    • warning: temporary bound to reference member of allocated object will be destroyed at the end of the full-expression
    • +
    • warning: %0 has a non-throwing exception specification but can still throw
    • +
    • warning: cannot refer to a non-static member from the handler of a %select{constructor|destructor}0 function try block
    • +
    • warning: exception of type %0 will be caught by earlier handler

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dangling-else - clang-diagnostic-dangling-else + clang-diagnostic-excess-initializers + clang-diagnostic-excess-initializers Diagnostic text:

      -
    • warning: add explicit braces to avoid dangling else
    • +
    • warning: excess elements in %select{array|vector|scalar|union|struct}0 initializer
    • +
    • warning: excess elements in char array initializer
    • +
    • warning: excess elements in initializer for indivisible sizeless type %0
    • +
    • warning: initializer-string for char array is too long

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dangling-field - clang-diagnostic-dangling-field + clang-diagnostic-exit-time-destructors + clang-diagnostic-exit-time-destructors Diagnostic text:

      -
    • warning: %select{reference|backing array for 'std::initializer_list'}2 %select{|subobject of }1member %0 %select{binds to|is}2 a temporary object whose lifetime is shorter than the lifetime of the constructed object
    • -
    • warning: binding reference member %0 to stack allocated %select{variable|parameter}2 %1
    • -
    • warning: initializing pointer member %0 with the stack address of %select{variable|parameter}2 %1
    • -
    • warning: temporary bound to reference member of allocated object will be destroyed at the end of the full-expression
    • +
    • warning: declaration requires an exit-time destructor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dangling-gsl - clang-diagnostic-dangling-gsl + clang-diagnostic-expansion-to-defined + clang-diagnostic-expansion-to-defined Diagnostic text:

      -
    • warning: initializing pointer member %0 to point to a temporary object whose lifetime is shorter than the lifetime of the constructed object
    • -
    • warning: object backing the pointer will be destroyed at the end of the full-expression
    • +
    • warning: macro expansion producing 'defined' has undefined behavior
    • +
    • warning: macro expansion producing 'defined' has undefined behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dangling-initializer-list - clang-diagnostic-dangling-initializer-list + clang-diagnostic-explicit-initialize-call + clang-diagnostic-explicit-initialize-call Diagnostic text:

      -
    • warning: array backing %select{initializer list subobject of the allocated object|the allocated initializer list}0 will be destroyed at the end of the full-expression
    • +
    • warning: explicit call to +initialize results in duplicate call to +initialize
    • +
    • warning: explicit call to [super initialize] should only be in implementation of +initialize

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dealloc-in-category - clang-diagnostic-dealloc-in-category + clang-diagnostic-export-unnamed + clang-diagnostic-export-unnamed Diagnostic text:

      -
    • warning: -dealloc is being overridden in a category
    • +
    • warning: ISO C++20 does not permit %select{an empty|a static_assert}0 declaration to appear in an export block
    • +
    • warning: ISO C++20 does not permit a declaration that does not introduce any names to be exported

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-declaration-after-statement - clang-diagnostic-declaration-after-statement + clang-diagnostic-extern-c-compat + clang-diagnostic-extern-c-compat Diagnostic text:

      -
    • warning: mixing declarations and code is a C99 extension
    • -
    • warning: mixing declarations and code is incompatible with standards before C99
    • +
    • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-defaulted-function-deleted - clang-diagnostic-defaulted-function-deleted + clang-diagnostic-extra + clang-diagnostic-extra Diagnostic text:

      -
    • warning: explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly deleted
    • -
    • warning: explicitly defaulted %sub{select_special_member_kind}0 is implicitly deleted
    • +
    • warning: '%0' qualifier on function type %1 has no effect
    • +
    • warning: '%0' qualifier on omitted return type %1 has no effect
    • +
    • warning: '%0' qualifier on reference type %1 has no effect
    • +
    • warning: '%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect
    • +
    • warning: '-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead
    • +
    • warning: ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 lifetime qualifier on return type is ignored
    • +
    • warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension
    • +
    • warning: call to function without interrupt attribute could clobber interruptee's VFP registers
    • +
    • warning: comparison of integers of different signs: %0 and %1
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared copy %select{assignment operator|constructor}1
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided copy %select{assignment operator|constructor}1
    • +
    • warning: empty initialization statement of '%select{if|switch|range-based for}0' has no effect
    • +
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • +
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • +
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • +
    • warning: method has no return type specified; defaults to 'id'
    • +
    • warning: missing field %0 initializer
    • +
    • warning: parameter %0 set but not used
    • +
    • warning: performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0
    • +
    • warning: performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior
    • +
    • warning: semicolon before method body is ignored
    • +
    • warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?
    • +
    • warning: unused parameter %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-delegating-ctor-cycles - clang-diagnostic-delegating-ctor-cycles + clang-diagnostic-extra-semi + clang-diagnostic-extra-semi Diagnostic text:

      -
    • warning: constructor for %0 creates a delegation cycle
    • +
    • warning: extra ';' %select{outside of a function|inside a %1|inside instance variable list|after member function definition}0
    • +
    • warning: extra ';' after member function definition
    • +
    • warning: extra ';' outside of a function is a C++11 extension
    • +
    • warning: extra ';' outside of a function is incompatible with C++98

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-delete-abstract-non-virtual-dtor - clang-diagnostic-delete-abstract-non-virtual-dtor + clang-diagnostic-extra-semi-stmt + clang-diagnostic-extra-semi-stmt Diagnostic text:

      -
    • warning: %select{delete|destructor}0 called on %1 that is abstract but has non-virtual destructor
    • +
    • warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning
    • +
    • warning: empty initialization statement of '%select{if|switch|range-based for}0' has no effect

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-delete-incomplete - clang-diagnostic-delete-incomplete + clang-diagnostic-extra-tokens + clang-diagnostic-extra-tokens Diagnostic text:

      -
    • warning: cannot delete expression with pointer-to-'void' type %0
    • -
    • warning: deleting pointer to incomplete type %0 may cause undefined behavior
    • +
    • warning: extra tokens at end of #%0 directive
    • +
    • warning: extra tokens at the end of '#pragma omp %0' are ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-delete-non-abstract-non-virtual-dtor - clang-diagnostic-delete-non-abstract-non-virtual-dtor + clang-diagnostic-fuse-ld-path + clang-diagnostic-fuse-ld-path Diagnostic text:

      -
    • warning: %select{delete|destructor}0 called on non-final %1 that has virtual functions but non-virtual destructor
    • +
    • warning: '-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-delete-non-virtual-dtor - clang-diagnostic-delete-non-virtual-dtor + clang-diagnostic-final-dtor-non-final-class + clang-diagnostic-final-dtor-non-final-class Diagnostic text:

      -
    • warning: %select{delete|destructor}0 called on %1 that is abstract but has non-virtual destructor
    • -
    • warning: %select{delete|destructor}0 called on non-final %1 that has virtual functions but non-virtual destructor
    • +
    • warning: class with destructor marked '%select{final|sealed}0' cannot be inherited from

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated - clang-diagnostic-deprecated + clang-diagnostic-final-macro + clang-diagnostic-final-macro Diagnostic text:

      -
    • warning: %0 does not support the option '%1'
    • -
    • warning: %0 is deprecated
    • -
    • warning: %0 is deprecated: %1
    • -
    • warning: %0 may be deprecated because the receiver type is unknown
    • -
    • warning: %select{decrement|increment}0 of object of volatile-qualified type %1 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: '_ExtInt' is deprecated; use '_BitInt' instead
    • -
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • -
    • warning: -O4 is equivalent to -O3
    • -
    • warning: -fconcepts-ts is deprecated - use '-std=c++20' for Concepts support
    • -
    • warning: Use of 'long' with '__vector' is deprecated
    • -
    • warning: access declarations are deprecated; use using declarations instead
    • -
    • warning: argument '%0' is deprecated, use '%1' instead
    • -
    • warning: comparison between two arrays is deprecated; to compare array addresses, use unary '+' to decay operands to pointers
    • -
    • warning: compound assignment to object of volatile-qualified type %0 is deprecated
    • -
    • warning: conversion from string literal to %0 is deprecated
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared copy %select{assignment operator|constructor}1
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared destructor
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided copy %select{assignment operator|constructor}1
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided destructor
    • -
    • warning: dynamic exception specifications are deprecated
    • -
    • warning: implicit capture of 'this' with a capture default of '=' is deprecated
    • -
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • -
    • warning: macro %0 has been marked as deprecated%select{|: %2}1
    • -
    • warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated
    • -
    • warning: property access is using %0 method which is deprecated
    • -
    • warning: specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead
    • -
    • warning: specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead
    • -
    • warning: the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use '[[noreturn]]' instead
    • -
    • warning: top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++2b
    • -
    • warning: treating '%0' input as '%1' when in C++ mode, this behavior is deprecated
    • -
    • warning: use of C-style parameters in Objective-C method declarations is deprecated
    • -
    • warning: use of result of assignment to object of volatile-qualified type %0 is deprecated
    • -
    • warning: volatile qualifier in structured binding declaration is deprecated
    • -
    • warning: volatile-qualified parameter type %0 is deprecated
    • -
    • warning: volatile-qualified return type %0 is deprecated
    • +
    • warning: macro %0 has been marked as final and should not be %select{undefined|redefined}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-anon-enum-enum-conversion - clang-diagnostic-deprecated-anon-enum-enum-conversion + clang-diagnostic-flag-enum + clang-diagnostic-flag-enum Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: enumeration value %0 is out of range of flags in enumeration type %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-array-compare - clang-diagnostic-deprecated-array-compare + clang-diagnostic-flexible-array-extensions + clang-diagnostic-flexible-array-extensions Diagnostic text:

      -
    • warning: comparison between two arrays is deprecated; to compare array addresses, use unary '+' to decay operands to pointers
    • +
    • warning: %0 may not be nested in a struct due to flexible array member
    • +
    • warning: %0 may not be used as an array element due to flexible array member

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-attributes - clang-diagnostic-deprecated-attributes + clang-diagnostic-float-conversion + clang-diagnostic-float-conversion Diagnostic text:

      -
    • warning: specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead
    • -
    • warning: the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use '[[noreturn]]' instead
    • +
    • warning: implicit conversion from %0 to %1 changes non-zero value from %2 to %3
    • +
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • +
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • +
    • warning: implicit conversion turns floating-point number into integer: %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-comma-subscript - clang-diagnostic-deprecated-comma-subscript + clang-diagnostic-float-overflow-conversion + clang-diagnostic-float-overflow-conversion Diagnostic text:

      -
    • warning: top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++2b
    • +
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • +
    • warning: implicit conversion of out of range value from %0 to %1 is undefined

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-copy - clang-diagnostic-deprecated-copy + clang-diagnostic-float-zero-conversion + clang-diagnostic-float-zero-conversion Diagnostic text:

      -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared copy %select{assignment operator|constructor}1
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided copy %select{assignment operator|constructor}1
    • +
    • warning: implicit conversion from %0 to %1 changes non-zero value from %2 to %3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-copy-with-dtor - clang-diagnostic-deprecated-copy-with-dtor + clang-diagnostic-for-loop-analysis + clang-diagnostic-for-loop-analysis Diagnostic text:

      -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared destructor
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided destructor
    • +
    • warning: variable %0 is %select{decremented|incremented}1 both in the loop header and in the loop body
    • +
    • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-copy-with-user-provided-copy - clang-diagnostic-deprecated-copy-with-user-provided-copy + clang-diagnostic-format + clang-diagnostic-format Diagnostic text:

      -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided copy %select{assignment operator|constructor}1
    • +
    • warning: %select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior
    • +
    • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
    • +
    • warning: %sub{subst_format_overflow}0,1,2
    • +
    • warning: %sub{subst_format_overflow}0,1,2
    • +
    • warning: %sub{subst_format_truncation}0,1,2
    • +
    • warning: %sub{subst_format_truncation}0,1,2
    • +
    • warning: '%%n' specifier not supported on this platform
    • +
    • warning: '%0' is not a valid object format flag
    • +
    • warning: '%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument
    • +
    • warning: cannot mix positional and non-positional arguments in format string
    • +
    • warning: data argument not used by format string
    • +
    • warning: data argument position '%0' exceeds the number of data arguments (%1)
    • +
    • warning: field %select{width|precision}0 should have type %1, but argument has type %2
    • +
    • warning: flag '%0' is ignored when flag '%1' is present
    • +
    • warning: flag '%0' results in undefined behavior with '%1' conversion specifier
    • +
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1
    • +
    • warning: format string contains '\0' within the string body
    • +
    • warning: format string is empty
    • +
    • warning: format string is not a string literal (potentially insecure)
    • +
    • warning: format string is not null-terminated
    • +
    • warning: format string missing
    • +
    • warning: format string should not be a wide string
    • +
    • warning: incomplete format specifier
    • +
    • warning: invalid conversion specifier '%0'
    • +
    • warning: invalid position specified for %select{field width|field precision}0
    • +
    • warning: length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier
    • +
    • warning: missing object format flag
    • +
    • warning: more '%%' conversions than data arguments
    • +
    • warning: no closing ']' for '%%[' in scanf format string
    • +
    • warning: null passed to a callee that requires a non-null argument
    • +
    • warning: null returned from %select{function|method}0 that requires a non-null return value
    • +
    • warning: object format flags cannot be used with '%0' conversion specifier
    • +
    • warning: position arguments in format strings start counting at 1 (not 0)
    • +
    • warning: using '%%P' format specifier without precision
    • +
    • warning: using '%0' format specifier annotation outside of os_log()/os_trace()
    • +
    • warning: using '%0' format specifier, but argument has boolean value
    • +
    • warning: zero field width in scanf format string is unused

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-copy-with-user-provided-dtor - clang-diagnostic-deprecated-copy-with-user-provided-dtor + clang-diagnostic-format=2 + clang-diagnostic-format=2 Diagnostic text:

      -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided destructor
    • +
    • warning: format string is not a string literal
    • +
    • warning: format string is not a string literal (potentially insecure)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-coroutine - clang-diagnostic-deprecated-coroutine + clang-diagnostic-format-extra-args + clang-diagnostic-format-extra-args Diagnostic text:

      -
    • warning: 'for co_await' belongs to CoroutineTS instead of C++20, which is deprecated
    • -
    • warning: support for std::experimental::%0 will be removed in LLVM 15; use std::%0 instead
    • +
    • warning: data argument not used by format string

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-declarations - clang-diagnostic-deprecated-declarations + clang-diagnostic-format-insufficient-args + clang-diagnostic-format-insufficient-args Diagnostic text:

      -
    • warning: %0 is deprecated
    • -
    • warning: %0 is deprecated: %1
    • -
    • warning: %0 may be deprecated because the receiver type is unknown
    • -
    • warning: property access is using %0 method which is deprecated
    • -
    • warning: specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead
    • -
    • warning: use of C-style parameters in Objective-C method declarations is deprecated
    • +
    • warning: more '%%' conversions than data arguments

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-dynamic-exception-spec - clang-diagnostic-deprecated-dynamic-exception-spec + clang-diagnostic-format-invalid-specifier + clang-diagnostic-format-invalid-specifier Diagnostic text:

      -
    • warning: dynamic exception specifications are deprecated
    • +
    • warning: invalid conversion specifier '%0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-enum-compare - clang-diagnostic-deprecated-enum-compare + clang-diagnostic-format-nonliteral + clang-diagnostic-format-nonliteral Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: format string is not a string literal

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-enum-compare-conditional - clang-diagnostic-deprecated-enum-compare-conditional + clang-diagnostic-format-non-iso + clang-diagnostic-format-non-iso Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: '%0' %select{length modifier|conversion specifier}1 is not supported by ISO C
    • +
    • warning: positional arguments are not supported by ISO C
    • +
    • warning: using length modifier '%0' with conversion specifier '%1' is not supported by ISO C

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-enum-enum-conversion - clang-diagnostic-deprecated-enum-enum-conversion + clang-diagnostic-format-overflow + clang-diagnostic-format-overflow Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: %sub{subst_format_overflow}0,1,2
    • +
    • warning: %sub{subst_format_overflow}0,1,2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-enum-float-conversion - clang-diagnostic-deprecated-enum-float-conversion + clang-diagnostic-format-overflow-non-kprintf + clang-diagnostic-format-overflow-non-kprintf Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • +
    • warning: %sub{subst_format_overflow}0,1,2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-experimental-coroutine - clang-diagnostic-deprecated-experimental-coroutine + clang-diagnostic-format-pedantic + clang-diagnostic-format-pedantic Diagnostic text:

      -
    • warning: support for std::experimental::%0 will be removed in LLVM 15; use std::%0 instead
    • +
    • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
    • +
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-implementations - clang-diagnostic-deprecated-implementations + clang-diagnostic-format-security + clang-diagnostic-format-security Diagnostic text:

      -
    • warning: implementing deprecated %select{method|class|category}0
    • -
    • warning: implementing unavailable method
    • +
    • warning: format string is not a string literal (potentially insecure)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-increment-bool - clang-diagnostic-deprecated-increment-bool + clang-diagnostic-format-truncation + clang-diagnostic-format-truncation Diagnostic text:

      -
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • +
    • warning: %sub{subst_format_truncation}0,1,2
    • +
    • warning: %sub{subst_format_truncation}0,1,2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-objc-isa-usage - clang-diagnostic-deprecated-objc-isa-usage + clang-diagnostic-format-truncation-non-kprintf + clang-diagnostic-format-truncation-non-kprintf Diagnostic text:

      -
    • warning: assignment to Objective-C's isa is deprecated in favor of object_setClass()
    • -
    • warning: direct access to Objective-C's isa is deprecated in favor of object_getClass()
    • +
    • warning: %sub{subst_format_truncation}0,1,2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-pragma - clang-diagnostic-deprecated-pragma + clang-diagnostic-format-type-confusion + clang-diagnostic-format-type-confusion Diagnostic text:

      -
    • warning: macro %0 has been marked as deprecated%select{|: %2}1
    • +
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-register - clang-diagnostic-deprecated-register + clang-diagnostic-format-zero-length + clang-diagnostic-format-zero-length Diagnostic text:

      -
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • +
    • warning: format string is empty

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-this-capture - clang-diagnostic-deprecated-this-capture + clang-diagnostic-fortify-source + clang-diagnostic-fortify-source Diagnostic text:

      -
    • warning: implicit capture of 'this' with a capture default of '=' is deprecated
    • +
    • warning: %sub{subst_format_overflow}0,1,2
    • +
    • warning: %sub{subst_format_overflow}0,1,2
    • +
    • warning: %sub{subst_format_truncation}0,1,2
    • +
    • warning: %sub{subst_format_truncation}0,1,2
    • +
    • warning: '%0' may overflow; destination buffer in argument %1 has size %2, but the corresponding specifier may require size %3
    • +
    • warning: '%0' size argument is too large; destination buffer has size %1, but size argument is %2
    • +
    • warning: '%0' will always overflow; destination buffer has size %1, but size argument is %2
    • +
    • warning: '%0' will always overflow; destination buffer has size %1, but the source string has length %2 (including NUL byte)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-type - clang-diagnostic-deprecated-type + clang-diagnostic-receiver-forward-class + clang-diagnostic-receiver-forward-class Diagnostic text:

      -
    • warning: '_ExtInt' is deprecated; use '_BitInt' instead
    • +
    • warning: receiver %0 is a forward class and corresponding @interface may not exist
    • +
    • warning: receiver type %0 for instance message is a forward declaration

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-volatile - clang-diagnostic-deprecated-volatile + clang-diagnostic-four-char-constants + clang-diagnostic-four-char-constants Diagnostic text:

      -
    • warning: %select{decrement|increment}0 of object of volatile-qualified type %1 is deprecated
    • -
    • warning: compound assignment to object of volatile-qualified type %0 is deprecated
    • -
    • warning: use of result of assignment to object of volatile-qualified type %0 is deprecated
    • -
    • warning: volatile qualifier in structured binding declaration is deprecated
    • -
    • warning: volatile-qualified parameter type %0 is deprecated
    • -
    • warning: volatile-qualified return type %0 is deprecated
    • +
    • warning: multi-character character constant

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-writable-strings - clang-diagnostic-deprecated-writable-strings + clang-diagnostic-frame-address + clang-diagnostic-frame-address Diagnostic text:

      -
    • warning: conversion from string literal to %0 is deprecated
    • +
    • warning: calling '%0' with a nonzero argument is unsafe

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-distributed-object-modifiers - clang-diagnostic-distributed-object-modifiers + clang-diagnostic-atimport-in-framework-header + clang-diagnostic-atimport-in-framework-header Diagnostic text:

      -
    • warning: conflicting distributed object modifiers on parameter type in implementation of %0
    • -
    • warning: conflicting distributed object modifiers on return type in implementation of %0
    • +
    • warning: use of '@import' in framework header is discouraged, including this header requires -fmodules

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-division-by-zero - clang-diagnostic-division-by-zero + clang-diagnostic-quoted-include-in-framework-header + clang-diagnostic-quoted-include-in-framework-header Diagnostic text:

      -
    • warning: %select{remainder|division}0 by zero is undefined
    • +
    • warning: double-quoted include "%0" in framework header, expected angle-bracketed instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dllexport-explicit-instantiation-decl - clang-diagnostic-dllexport-explicit-instantiation-decl + clang-diagnostic-framework-include-private-from-public + clang-diagnostic-framework-include-private-from-public Diagnostic text:

      -
    • warning: explicit instantiation declaration should not be 'dllexport'
    • +
    • warning: public framework header includes private framework header '%0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-documentation - clang-diagnostic-documentation + clang-diagnostic-free-nonheap-object + clang-diagnostic-free-nonheap-object Diagnostic text:

      -
    • warning: '%select{\|@}0%1' command does not have a valid word argument
    • -
    • warning: '%select{\|@}0%1' command does not terminate a verbatim text block
    • -
    • warning: '%select{\|@}0%1' command used in a comment that is attached to a %select{function returning void|constructor|destructor|method returning void}2
    • -
    • warning: '%select{\|@}0%1' command used in a comment that is not attached to a function or method declaration
    • -
    • warning: '%select{\|@}0%select{classdesign|coclass|dependency|helper|helperclass|helps|instancesize|ownership|performance|security|superclass}1' command should not be used in a comment attached to a non-container declaration
    • -
    • warning: '%select{\|@}0%select{class|interface|protocol|struct|union}1' command should not be used in a comment attached to a non-%select{class|interface|protocol|struct|union}2 declaration
    • -
    • warning: '%select{\|@}0%select{function|functiongroup|method|methodgroup|callback}1' command should be used in a comment attached to %select{a function|a function|an Objective-C method|an Objective-C method|a pointer to function}2 declaration
    • -
    • warning: '%select{\|@}0param' command used in a comment that is not attached to a function declaration
    • -
    • warning: '%select{\|@}0tparam' command used in a comment that is not attached to a template declaration
    • -
    • warning: HTML end tag '%0' is forbidden
    • -
    • warning: HTML end tag does not match any start tag
    • -
    • warning: HTML start tag '%0' closed by '%1'
    • -
    • warning: HTML start tag prematurely ended, expected attribute name or '>'
    • -
    • warning: HTML tag '%0' requires an end tag
    • -
    • warning: declaration is marked with '%select{\|@}0deprecated' command but does not have a deprecation attribute
    • -
    • warning: duplicated command '%select{\|@}0%1'
    • -
    • warning: empty paragraph passed to '%select{\|@}0%1' command
    • -
    • warning: expected quoted string after equals sign
    • -
    • warning: not a Doxygen trailing comment
    • -
    • warning: parameter '%0' is already documented
    • -
    • warning: parameter '%0' not found in the function declaration
    • -
    • warning: template parameter '%0' is already documented
    • -
    • warning: template parameter '%0' not found in the template declaration
    • -
    • warning: unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'
    • +
    • warning: attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-documentation-deprecated-sync - clang-diagnostic-documentation-deprecated-sync + clang-diagnostic-function-def-in-objc-container + clang-diagnostic-function-def-in-objc-container Diagnostic text:

      -
    • warning: declaration is marked with '%select{\|@}0deprecated' command but does not have a deprecation attribute
    • +
    • warning: function definition inside an Objective-C container is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-documentation-html - clang-diagnostic-documentation-html + clang-diagnostic-function-multiversion + clang-diagnostic-function-multiversion Diagnostic text:

      -
    • warning: HTML end tag '%0' is forbidden
    • -
    • warning: HTML end tag does not match any start tag
    • -
    • warning: HTML start tag '%0' closed by '%1'
    • -
    • warning: HTML tag '%0' requires an end tag
    • +
    • warning: CPU list contains duplicate entries; attribute ignored
    • +
    • warning: body of cpu_dispatch function will be ignored
    • +
    • warning: mixing 'target_clones' specifier mechanisms is permitted for GCC compatibility; use a comma separated sequence of string literals, or a string literal containing a comma-separated list of versions
    • +
    • warning: version list contains duplicate entries
    • +
    • warning: version list contains entries that don't impact code generation

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-documentation-pedantic - clang-diagnostic-documentation-pedantic + clang-diagnostic-future-attribute-extensions + clang-diagnostic-future-attribute-extensions Diagnostic text:

      -
    • warning: unknown command tag name
    • -
    • warning: unknown command tag name '%0'; did you mean '%1'?
    • -
    • warning: whitespace is not allowed in parameter passing direction
    • +
    • warning: use of the %0 attribute is a C++14 extension
    • +
    • warning: use of the %0 attribute is a C++17 extension
    • +
    • warning: use of the %0 attribute is a C++20 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-documentation-unknown-command - clang-diagnostic-documentation-unknown-command + clang-diagnostic-write-strings + clang-diagnostic-write-strings Diagnostic text:

      -
    • warning: unknown command tag name
    • -
    • warning: unknown command tag name '%0'; did you mean '%1'?
    • +
    • warning: ISO C++11 does not allow conversion from string literal to %0
    • +
    • warning: conversion from string literal to %0 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-double-promotion - clang-diagnostic-double-promotion + clang-diagnostic-gnu + clang-diagnostic-gnu Diagnostic text:

      -
    • warning: implicit conversion increases floating-point precision: %0 to %1
    • +
    • warning: #include_next is a language extension
    • +
    • warning: #line directive with zero argument is a GNU extension
    • +
    • warning: %0 applied to an expression is a GNU extension
    • +
    • warning: %select{struct|union}0 without named members is a GNU extension
    • +
    • warning: '__auto_type' is a GNU extension
    • +
    • warning: anonymous structs are a GNU extension
    • +
    • warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension
    • +
    • warning: arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension
    • +
    • warning: arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function type%select{|s}2 %1%select{| and %3}2 is a GNU extension
    • +
    • warning: binary integer literals are a GNU extension
    • +
    • warning: cast to union type is a GNU extension
    • +
    • warning: class member cannot be redeclared
    • +
    • warning: complex integer types are a GNU extension
    • +
    • warning: defining a type within '%select{__builtin_offsetof|offsetof}0' is a Clang extension
    • +
    • warning: empty %select{struct|union}0 is a GNU extension
    • +
    • warning: expression is not an %select{integer|integral}0 constant expression; folding it to a constant is a GNU extension
    • +
    • warning: field %0 with variable sized type %1 not at the end of a struct or class is a GNU extension
    • +
    • warning: flexible array initialization is a GNU extension
    • +
    • warning: flexible array member %0 in a union is a GNU extension
    • +
    • warning: flexible array member %0 in otherwise empty %select{struct|interface|union|class|enum}1 is a GNU extension
    • +
    • warning: imaginary constants are a GNU extension
    • +
    • warning: in-class initializer for static data member is not a constant expression; folding it to a constant is a GNU extension
    • +
    • warning: in-class initializer for static data member of type %0 is a GNU extension
    • +
    • warning: initialization of an array %diff{of type $ from a compound literal of type $|from a compound literal}0,1 is a GNU extension
    • +
    • warning: must specify at least one argument for '...' parameter of variadic macro
    • +
    • warning: redeclaration of already-defined enum %0 is a GNU extension
    • +
    • warning: string literal operator templates are a GNU extension
    • +
    • warning: subscript of a pointer to void is a GNU extension
    • +
    • warning: this style of line directive is a GNU extension
    • +
    • warning: token pasting of ',' and __VA_ARGS__ is a GNU extension
    • +
    • warning: use of GNU 'missing =' extension in designator
    • +
    • warning: use of GNU ?: conditional expression extension, omitting middle operand
    • +
    • warning: use of GNU address-of-label extension
    • +
    • warning: use of GNU array range extension
    • +
    • warning: use of GNU case range extension
    • +
    • warning: use of GNU indirect-goto extension
    • +
    • warning: use of GNU old-style field designator extension
    • +
    • warning: use of GNU statement expression extension
    • +
    • warning: use of GNU statement expression extension from macro expansion
    • +
    • warning: variable length array folded to constant array as an extension
    • +
    • warning: variable length arrays are a C99 feature
    • +
    • warning: variable length arrays in C++ are a Clang extension
    • +
    • warning: variable length arrays in C++ are a Clang extension
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
    • +
    • warning: zero size arrays are an extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dtor-name - clang-diagnostic-dtor-name + clang-diagnostic-gnu-alignof-expression + clang-diagnostic-gnu-alignof-expression Diagnostic text:

      -
    • warning: ISO C++ considers this destructor name lookup to be ambiguous
    • -
    • warning: ISO C++ requires the name after '::~' to be found in the same scope as the name before '::~'
    • -
    • warning: qualified destructor name only found in lexical scope; omit the qualifier to find this type name by unqualified lookup
    • +
    • warning: %0 applied to an expression is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-duplicate-method-arg - clang-diagnostic-duplicate-method-arg + clang-diagnostic-gnu-anonymous-struct + clang-diagnostic-gnu-anonymous-struct Diagnostic text:

      -
    • warning: redeclaration of method parameter %0
    • +
    • warning: anonymous structs are a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-duplicate-decl-specifier - clang-diagnostic-duplicate-decl-specifier + clang-diagnostic-gnu-auto-type + clang-diagnostic-gnu-auto-type Diagnostic text:

      -
    • warning: %sub{duplicate_declspec}0
    • -
    • warning: %sub{duplicate_declspec}0
    • -
    • warning: %sub{duplicate_declspec}0
    • -
    • warning: multiple identical address spaces specified for type
    • +
    • warning: '__auto_type' is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dynamic-class-memaccess - clang-diagnostic-dynamic-class-memaccess + clang-diagnostic-gnu-binary-literal + clang-diagnostic-gnu-binary-literal Diagnostic text:

      -
    • warning: %select{destination for|source of|first operand of|second operand of}0 this %1 call is a pointer to %select{|class containing a }2dynamic class %3; vtable pointer will be %select{overwritten|copied|moved|compared}4
    • +
    • warning: binary integer literals are a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dynamic-exception-spec - clang-diagnostic-dynamic-exception-spec + clang-diagnostic-gnu-case-range + clang-diagnostic-gnu-case-range Diagnostic text:

      -
    • warning: ISO C++17 does not allow dynamic exception specifications
    • -
    • warning: dynamic exception specifications are deprecated
    • +
    • warning: use of GNU case range extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-empty-body - clang-diagnostic-empty-body + clang-diagnostic-gnu-complex-integer + clang-diagnostic-gnu-complex-integer Diagnostic text:

      -
    • warning: for loop has empty body
    • -
    • warning: if statement has empty body
    • -
    • warning: range-based for loop has empty body
    • -
    • warning: switch statement has empty body
    • -
    • warning: while loop has empty body
    • +
    • warning: complex integer types are a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-empty-init-stmt - clang-diagnostic-empty-init-stmt + clang-diagnostic-gnu-compound-literal-initializer + clang-diagnostic-gnu-compound-literal-initializer Diagnostic text:

      -
    • warning: empty initialization statement of '%select{if|switch|range-based for}0' has no effect
    • +
    • warning: initialization of an array %diff{of type $ from a compound literal of type $|from a compound literal}0,1 is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-enum-compare - clang-diagnostic-enum-compare + clang-diagnostic-gnu-conditional-omitted-operand + clang-diagnostic-gnu-conditional-omitted-operand Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: comparison of different enumeration types in switch statement%diff{ ($ and $)|}0,1
    • +
    • warning: use of GNU ?: conditional expression extension, omitting middle operand

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-enum-compare-conditional - clang-diagnostic-enum-compare-conditional + clang-diagnostic-gnu-designator + clang-diagnostic-gnu-designator Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: use of GNU 'missing =' extension in designator
    • +
    • warning: use of GNU array range extension
    • +
    • warning: use of GNU old-style field designator extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-enum-compare-switch - clang-diagnostic-enum-compare-switch + clang-diagnostic-gnu-empty-initializer + clang-diagnostic-gnu-empty-initializer Diagnostic text:

      -
    • warning: comparison of different enumeration types in switch statement%diff{ ($ and $)|}0,1
    • +
    • warning: use of GNU empty initializer extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-enum-conversion - clang-diagnostic-enum-conversion + clang-diagnostic-gnu-empty-struct + clang-diagnostic-gnu-empty-struct Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3
    • -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: implicit conversion from enumeration type %0 to different enumeration type %1
    • +
    • warning: %select{struct|union}0 without named members is a GNU extension
    • +
    • warning: empty %select{struct|union}0 is a GNU extension
    • +
    • warning: flexible array member %0 in otherwise empty %select{struct|interface|union|class|enum}1 is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-enum-enum-conversion - clang-diagnostic-enum-enum-conversion + clang-diagnostic-gnu-flexible-array-initializer + clang-diagnostic-gnu-flexible-array-initializer Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: flexible array initialization is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-enum-float-conversion - clang-diagnostic-enum-float-conversion + clang-diagnostic-gnu-flexible-array-union-member + clang-diagnostic-gnu-flexible-array-union-member Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3
    • -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • +
    • warning: flexible array member %0 in a union is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-enum-too-large - clang-diagnostic-enum-too-large + clang-diagnostic-gnu-folding-constant + clang-diagnostic-gnu-folding-constant Diagnostic text:

      -
    • warning: enumeration values exceed range of largest integer
    • -
    • warning: incremented enumerator value %0 is not representable in the largest integer type
    • +
    • warning: expression is not an %select{integer|integral}0 constant expression; folding it to a constant is a GNU extension
    • +
    • warning: in-class initializer for static data member is not a constant expression; folding it to a constant is a GNU extension
    • +
    • warning: variable length array folded to constant array as an extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-exceptions - clang-diagnostic-exceptions + clang-diagnostic-gnu-imaginary-constant + clang-diagnostic-gnu-imaginary-constant Diagnostic text:

      -
    • warning: %0 has a non-throwing exception specification but can still throw
    • -
    • warning: cannot refer to a non-static member from the handler of a %select{constructor|destructor}0 function try block
    • -
    • warning: exception of type %0 will be caught by earlier handler
    • +
    • warning: imaginary constants are a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-excess-initializers - clang-diagnostic-excess-initializers + clang-diagnostic-gnu-include-next + clang-diagnostic-gnu-include-next Diagnostic text:

      -
    • warning: excess elements in %select{array|vector|scalar|union|struct}0 initializer
    • -
    • warning: excess elements in char array initializer
    • -
    • warning: excess elements in initializer for indivisible sizeless type %0
    • -
    • warning: initializer-string for char array is too long
    • +
    • warning: #include_next is a language extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-exit-time-destructors - clang-diagnostic-exit-time-destructors + clang-diagnostic-gnu-label-as-value + clang-diagnostic-gnu-label-as-value Diagnostic text:

      -
    • warning: declaration requires an exit-time destructor
    • +
    • warning: use of GNU address-of-label extension
    • +
    • warning: use of GNU indirect-goto extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-expansion-to-defined - clang-diagnostic-expansion-to-defined + clang-diagnostic-gnu-line-marker + clang-diagnostic-gnu-line-marker Diagnostic text:

      -
    • warning: macro expansion producing 'defined' has undefined behavior
    • -
    • warning: macro expansion producing 'defined' has undefined behavior
    • +
    • warning: this style of line directive is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-explicit-initialize-call - clang-diagnostic-explicit-initialize-call + clang-diagnostic-gnu-null-pointer-arithmetic + clang-diagnostic-gnu-null-pointer-arithmetic Diagnostic text:

      -
    • warning: explicit call to +initialize results in duplicate call to +initialize
    • -
    • warning: explicit call to [super initialize] should only be in implementation of +initialize
    • +
    • warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-export-unnamed - clang-diagnostic-export-unnamed + clang-diagnostic-gnu-offsetof-extensions + clang-diagnostic-gnu-offsetof-extensions Diagnostic text:

      -
    • warning: ISO C++20 does not permit %select{an empty|a static_assert}0 declaration to appear in an export block
    • -
    • warning: ISO C++20 does not permit a declaration that does not introduce any names to be exported
    • +
    • warning: defining a type within '%select{__builtin_offsetof|offsetof}0' is a Clang extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-extern-c-compat - clang-diagnostic-extern-c-compat + clang-diagnostic-gnu-pointer-arith + clang-diagnostic-gnu-pointer-arith Diagnostic text:

      -
    • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++
    • +
    • warning: arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension
    • +
    • warning: arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function type%select{|s}2 %1%select{| and %3}2 is a GNU extension
    • +
    • warning: subscript of a pointer to void is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-extra - clang-diagnostic-extra + clang-diagnostic-gnu-redeclared-enum + clang-diagnostic-gnu-redeclared-enum Diagnostic text:

      -
    • warning: '%0' qualifier on function type %1 has no effect
    • -
    • warning: '%0' qualifier on omitted return type %1 has no effect
    • -
    • warning: '%0' qualifier on reference type %1 has no effect
    • -
    • warning: '%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect
    • -
    • warning: '-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead
    • -
    • warning: ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 lifetime qualifier on return type is ignored
    • -
    • warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension
    • -
    • warning: call to function without interrupt attribute could clobber interruptee's VFP registers
    • -
    • warning: comparison of integers of different signs: %0 and %1
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared copy %select{assignment operator|constructor}1
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided copy %select{assignment operator|constructor}1
    • -
    • warning: empty initialization statement of '%select{if|switch|range-based for}0' has no effect
    • -
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • -
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • -
    • warning: method has no return type specified; defaults to 'id'
    • -
    • warning: missing field %0 initializer
    • -
    • warning: parameter %0 set but not used
    • -
    • warning: performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0
    • -
    • warning: performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior
    • -
    • warning: semicolon before method body is ignored
    • -
    • warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?
    • -
    • warning: unused parameter %0
    • +
    • warning: redeclaration of already-defined enum %0 is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-extra-semi - clang-diagnostic-extra-semi + clang-diagnostic-gnu-statement-expression + clang-diagnostic-gnu-statement-expression Diagnostic text:

      -
    • warning: extra ';' %select{outside of a function|inside a %1|inside instance variable list|after member function definition}0
    • -
    • warning: extra ';' after member function definition
    • -
    • warning: extra ';' outside of a function is a C++11 extension
    • -
    • warning: extra ';' outside of a function is incompatible with C++98
    • +
    • warning: use of GNU statement expression extension
    • +
    • warning: use of GNU statement expression extension from macro expansion

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-extra-semi-stmt - clang-diagnostic-extra-semi-stmt + clang-diagnostic-gnu-statement-expression-from-macro-expansion + clang-diagnostic-gnu-statement-expression-from-macro-expansion Diagnostic text:

      -
    • warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning
    • -
    • warning: empty initialization statement of '%select{if|switch|range-based for}0' has no effect
    • +
    • warning: use of GNU statement expression extension from macro expansion

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-extra-tokens - clang-diagnostic-extra-tokens + clang-diagnostic-gnu-static-float-init + clang-diagnostic-gnu-static-float-init Diagnostic text:

      -
    • warning: extra tokens at end of #%0 directive
    • -
    • warning: extra tokens at the end of '#pragma omp %0' are ignored
    • +
    • warning: in-class initializer for static data member of type %0 is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-fuse-ld-path - clang-diagnostic-fuse-ld-path + clang-diagnostic-gnu-string-literal-operator-template + clang-diagnostic-gnu-string-literal-operator-template Diagnostic text:

      -
    • warning: '-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead
    • +
    • warning: string literal operator templates are a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-final-dtor-non-final-class - clang-diagnostic-final-dtor-non-final-class + clang-diagnostic-gnu-union-cast + clang-diagnostic-gnu-union-cast Diagnostic text:

      -
    • warning: class with destructor marked '%select{final|sealed}0' cannot be inherited from
    • +
    • warning: cast to union type is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-final-macro - clang-diagnostic-final-macro + clang-diagnostic-gnu-variable-sized-type-not-at-end + clang-diagnostic-gnu-variable-sized-type-not-at-end Diagnostic text:

      -
    • warning: macro %0 has been marked as final and should not be %select{undefined|redefined}1
    • +
    • warning: field %0 with variable sized type %1 not at the end of a struct or class is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-flag-enum - clang-diagnostic-flag-enum + clang-diagnostic-gnu-zero-line-directive + clang-diagnostic-gnu-zero-line-directive Diagnostic text:

      -
    • warning: enumeration value %0 is out of range of flags in enumeration type %1
    • +
    • warning: #line directive with zero argument is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-flexible-array-extensions - clang-diagnostic-flexible-array-extensions + clang-diagnostic-gnu-zero-variadic-macro-arguments + clang-diagnostic-gnu-zero-variadic-macro-arguments Diagnostic text:

      -
    • warning: %0 may not be nested in a struct due to flexible array member
    • -
    • warning: %0 may not be used as an array element due to flexible array member
    • +
    • warning: must specify at least one argument for '...' parameter of variadic macro
    • +
    • warning: token pasting of ',' and __VA_ARGS__ is a GNU extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-float-conversion - clang-diagnostic-float-conversion + clang-diagnostic-gcc-compat + clang-diagnostic-gcc-compat Diagnostic text:

      -
    • warning: implicit conversion from %0 to %1 changes non-zero value from %2 to %3
    • -
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • -
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • -
    • warning: implicit conversion turns floating-point number into integer: %0 to %1
    • +
    • warning: '%0' is bound to current loop, GCC binds it to the enclosing loop
    • +
    • warning: 'break' is bound to loop, GCC binds it to switch
    • +
    • warning: 'diagnose_if' is a clang extension
    • +
    • warning: 'enable_if' is a clang extension
    • +
    • warning: GCC does not allow %0 attribute in this position on a function definition
    • +
    • warning: GCC does not allow an attribute in this position on a function declaration
    • +
    • warning: GCC does not allow the %0 attribute to be written on a type
    • +
    • warning: GCC does not allow the 'cleanup' attribute argument to be anything other than a simple identifier
    • +
    • warning: GCC does not allow variable declarations in for loop initializers before C99
    • +
    • warning: GCC requires a function with the %0 attribute to be variadic
    • +
    • warning: __final is a GNU extension, consider using C++11 final

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-float-overflow-conversion - clang-diagnostic-float-overflow-conversion + clang-diagnostic-global-constructors + clang-diagnostic-global-constructors Diagnostic text:

      -
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • -
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • +
    • warning: declaration requires a global constructor
    • +
    • warning: declaration requires a global destructor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-float-zero-conversion - clang-diagnostic-float-zero-conversion + clang-diagnostic-global-isel + clang-diagnostic-global-isel Diagnostic text:

      -
    • warning: implicit conversion from %0 to %1 changes non-zero value from %2 to %3
    • +
    • warning: -fglobal-isel support for the '%0' architecture is incomplete
    • +
    • warning: -fglobal-isel support is incomplete for this architecture at the current optimization level

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-for-loop-analysis - clang-diagnostic-for-loop-analysis + clang-diagnostic-hip-only + clang-diagnostic-hip-only Diagnostic text:

      -
    • warning: variable %0 is %select{decremented|incremented}1 both in the loop header and in the loop body
    • -
    • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body
    • +
    • warning: '%0' is ignored since it is only supported for HIP

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format - clang-diagnostic-format + clang-diagnostic-hip-omp-target-directives + clang-diagnostic-hip-omp-target-directives Diagnostic text:

      -
    • warning: %select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior
    • -
    • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
    • -
    • warning: '%%n' specifier not supported on this platform
    • -
    • warning: '%0' is not a valid object format flag
    • -
    • warning: '%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument
    • -
    • warning: cannot mix positional and non-positional arguments in format string
    • -
    • warning: data argument not used by format string
    • -
    • warning: data argument position '%0' exceeds the number of data arguments (%1)
    • -
    • warning: field %select{width|precision}0 should have type %1, but argument has type %2
    • -
    • warning: flag '%0' is ignored when flag '%1' is present
    • -
    • warning: flag '%0' results in undefined behavior with '%1' conversion specifier
    • -
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1
    • -
    • warning: format string contains '\0' within the string body
    • -
    • warning: format string is empty
    • -
    • warning: format string is not a string literal (potentially insecure)
    • -
    • warning: format string is not null-terminated
    • -
    • warning: format string missing
    • -
    • warning: format string should not be a wide string
    • -
    • warning: incomplete format specifier
    • -
    • warning: invalid conversion specifier '%0'
    • -
    • warning: invalid position specified for %select{field width|field precision}0
    • -
    • warning: length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier
    • -
    • warning: missing object format flag
    • -
    • warning: more '%%' conversions than data arguments
    • -
    • warning: no closing ']' for '%%[' in scanf format string
    • -
    • warning: null passed to a callee that requires a non-null argument
    • -
    • warning: null returned from %select{function|method}0 that requires a non-null return value
    • -
    • warning: object format flags cannot be used with '%0' conversion specifier
    • -
    • warning: position arguments in format strings start counting at 1 (not 0)
    • -
    • warning: using '%%P' format specifier without precision
    • -
    • warning: using '%0' format specifier annotation outside of os_log()/os_trace()
    • -
    • warning: using '%0' format specifier, but argument has boolean value
    • -
    • warning: zero field width in scanf format string is unused
    • +
    • warning: HIP does not support OpenMP target directives; directive has been ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-format=2 - clang-diagnostic-format=2 + clang-diagnostic-hlsl-extensions + clang-diagnostic-hlsl-extensions Diagnostic text:

      -
    • warning: format string is not a string literal
    • -
    • warning: format string is not a string literal (potentially insecure)
    • +
    • warning: access specifiers are a clang HLSL extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-extra-args - clang-diagnostic-format-extra-args + clang-diagnostic-header-hygiene + clang-diagnostic-header-hygiene Diagnostic text:

      -
    • warning: data argument not used by format string
    • +
    • warning: using namespace directive in global context in header

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-insufficient-args - clang-diagnostic-format-insufficient-args + clang-diagnostic-ignored-attributes + clang-diagnostic-ignored-attributes Diagnostic text:

      -
    • warning: more '%%' conversions than data arguments
    • +
    • warning: %0 attribute argument '%1' not supported on a global variable
    • +
    • warning: %0 attribute argument not supported: %1
    • +
    • warning: %0 attribute can only be applied to instance variables or properties
    • +
    • warning: %0 attribute ignored
    • +
    • warning: %0 attribute ignored for field of type %1
    • +
    • warning: %0 attribute ignored on a non-definition declaration
    • +
    • warning: %0 attribute ignored on inline function
    • +
    • warning: %0 attribute ignored when parsing type
    • +
    • warning: %0 attribute is deprecated and ignored in %1
    • +
    • warning: %0 attribute is ignored because %1 is not a function pointer
    • +
    • warning: %0 attribute is ignored because there exists no call expression inside the statement
    • +
    • warning: %0 attribute isn't implemented by this Objective-C runtime
    • +
    • warning: %0 attribute only applies to %select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters
    • +
    • warning: %0 attribute only applies to %select{functions|methods|properties}1 that return %select{an Objective-C object|a pointer|a non-retainable pointer}2
    • +
    • warning: %0 attribute only applies to a pointer or reference (%1 is invalid)
    • +
    • warning: %0 attribute only applies to return values that are pointers
    • +
    • warning: %0 attribute only applies to return values that are pointers or references
    • +
    • warning: %0 attribute only applies to%select{| constant}1 pointer arguments
    • +
    • warning: %0 calling convention is not supported %select{for this target|on variadic function|on constructor/destructor|on builtin function}1
    • +
    • warning: %0 currently has no effect on a using declaration
    • +
    • warning: %0%select{ attribute|}1 only applies to %2
    • +
    • warning: %0%select{ attribute|}1 only applies to %select{functions|unions|variables and functions|functions and methods|functions, methods and blocks|functions, methods, and parameters|variables|variables and fields|variables, data members and tag types|types and namespaces|variables, functions and classes|kernel functions|non-K&R-style functions}2
    • +
    • warning: %q0 redeclared inline; %1 attribute ignored
    • +
    • warning: %select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to functions that have %select{no parameters|a 'void' return type}1
    • +
    • warning: %select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2
    • +
    • warning: %select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden
    • +
    • warning: %select{alignment|size}0 of field %1 (%2 bits) does not match the %select{alignment|size}0 of the first field in transparent union; transparent_union attribute ignored
    • +
    • warning: %select{unsupported|duplicate|unknown}0%select{| CPU| tune CPU}1 '%2' in the '%select{target|target_clones|target_version}3' attribute string; '%select{target|target_clones|target_version}3' attribute ignored
    • +
    • warning: '%0' attribute cannot be specified on a definition
    • +
    • warning: '%0' only applies to %select{function|pointer|Objective-C object or block pointer}1 types; type here is %2
    • +
    • warning: '%select{pure|const}0' attribute on function returning 'void'; attribute ignored
    • +
    • warning: '[[%select{nodiscard|gnu::warn_unused_result}0]]' attribute ignored when applied to a typedef; consider using '__attribute__((warn_unused_result))' or '[[clang::warn_unused_result]]' instead
    • +
    • warning: '__clang__' is a predefined macro name, not an attribute scope specifier; did you mean '_Clang' instead?
    • +
    • warning: 'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored
    • +
    • warning: 'cmse_nonsecure_entry' cannot be applied to functions with internal linkage
    • +
    • warning: 'const' attribute imposes more restrictions; 'pure' attribute ignored
    • +
    • warning: 'deprecated' attribute on anonymous namespace ignored
    • +
    • warning: 'dllexport' attribute ignored on explicit instantiation definition
    • +
    • warning: 'gnu_inline' attribute requires function to be marked 'inline', attribute ignored
    • +
    • warning: 'internal_linkage' attribute on a non-static local variable is ignored
    • +
    • warning: 'mig_server_routine' attribute only applies to routines that return a kern_return_t
    • +
    • warning: 'nocf_check' attribute ignored; use -fcf-protection to enable the attribute
    • +
    • warning: 'noderef' can only be used on an array or pointer type
    • +
    • warning: 'nonnull' attribute applied to function with no pointer arguments
    • +
    • warning: 'nonnull' attribute when used on parameters takes no arguments
    • +
    • warning: 'nothrow' attribute conflicts with exception specification; attribute ignored
    • +
    • warning: 'objc_externally_retained' can only be applied to local variables %select{of retainable type|with strong ownership}0
    • +
    • warning: 'require_constant_initialization' attribute added after initialization of variable
    • +
    • warning: 'sentinel' attribute only supported for variadic %select{functions|blocks}0
    • +
    • warning: 'sentinel' attribute requires named arguments
    • +
    • warning: 'sycl_kernel' attribute only applies to a function template with at least two template parameters
    • +
    • warning: 'trivial_abi' cannot be applied to %0
    • +
    • warning: Objective-C GC does not allow weak variables on the stack
    • +
    • warning: __declspec attribute %0 is not supported
    • +
    • warning: __weak attribute cannot be specified on a field declaration
    • +
    • warning: __weak attribute cannot be specified on an automatic variable when ARC is not enabled
    • +
    • warning: attribute %0 after definition is ignored
    • +
    • warning: attribute %0 cannot be applied to %select{functions|Objective-C method}1 without return value
    • +
    • warning: attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement
    • +
    • warning: attribute %0 has no effect when annotating an infinite loop
    • +
    • warning: attribute %0 ignored, because it cannot be applied to a type
    • +
    • warning: attribute %0 ignored, because it cannot be applied to omitted return type
    • +
    • warning: attribute %0 ignored, because it is not attached to a declaration
    • +
    • warning: attribute %0 is already applied
    • +
    • warning: attribute %0 is already applied with different arguments
    • +
    • warning: attribute %0 is ignored, place it after "%select{class|struct|interface|union|enum|enum class|enum struct}1" to apply attribute to type declaration
    • +
    • warning: attribute declaration must precede definition
    • +
    • warning: attribute is ignored on this statement as it only applies to functions; use '%0' on statements
    • +
    • warning: conflicting attributes %0 are ignored
    • +
    • warning: direct attribute on property %0 ignored (not implemented by this Objective-C runtime)
    • +
    • warning: first field of a transparent union cannot have %select{floating point|vector}0 type %1; transparent_union attribute ignored
    • +
    • warning: function template with 'sycl_kernel' attribute must have a 'void' return type
    • +
    • warning: function template with 'sycl_kernel' attribute must have a single parameter
    • +
    • warning: ignoring __declspec(allocator) because the function return type %0 is not a pointer or reference type
    • +
    • warning: import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the previous declaration
    • +
    • warning: import %select{module|name}0 cannot be applied to a function with a definition
    • +
    • warning: inheritance model ignored on %select{primary template|partial specialization}0
    • +
    • warning: maxclusterrank requires sm_90 or higher, CUDA arch provided: %0, ignoring %1 attribute
    • +
    • warning: qualifiers after comma in declarator list are ignored
    • +
    • warning: repeated RISC-V 'interrupt' attribute
    • +
    • warning: requested alignment is less than minimum alignment of %1 for type %0
    • +
    • warning: statement attribute %0 has higher precedence than function attribute '%select{always_inline|flatten|noinline}1'
    • +
    • warning: template parameter of a function template with the 'sycl_kernel' attribute cannot be a non-type template parameter
    • +
    • warning: transparent union definition must contain at least one field; transparent_union attribute ignored
    • +
    • warning: transparent_union attribute can only be applied to a union definition; attribute ignored
    • +
    • warning: unknown attribute '%0'
    • +
    • warning: unknown visibility %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-invalid-specifier - clang-diagnostic-format-invalid-specifier + clang-diagnostic-ignored-gch + clang-diagnostic-ignored-gch Diagnostic text:

      -
    • warning: invalid conversion specifier '%0'
    • +
    • warning: precompiled header '%0' was ignored because it is not a clang PCH file
    • +
    • warning: precompiled header directory '%0' was ignored because it contains no clang PCH files

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-nonliteral - clang-diagnostic-format-nonliteral + clang-diagnostic-ignored-optimization-argument + clang-diagnostic-ignored-optimization-argument Diagnostic text:

      -
    • warning: format string is not a string literal
    • +
    • warning: optimization flag '%0' is not supported
    • +
    • warning: optimization flag '%0' is not supported for target '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-non-iso - clang-diagnostic-format-non-iso + clang-diagnostic-ignored-pragma-intrinsic + clang-diagnostic-ignored-pragma-intrinsic Diagnostic text:

      -
    • warning: '%0' %select{length modifier|conversion specifier}1 is not supported by ISO C
    • -
    • warning: positional arguments are not supported by ISO C
    • -
    • warning: using length modifier '%0' with conversion specifier '%1' is not supported by ISO C
    • +
    • warning: %0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-pedantic - clang-diagnostic-format-pedantic + clang-diagnostic-ignored-pragma-optimize + clang-diagnostic-ignored-pragma-optimize Diagnostic text:

      -
    • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
    • -
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1
    • +
    • warning: '#pragma optimize' is not supported

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-security - clang-diagnostic-format-security + clang-diagnostic-ignored-pragmas + clang-diagnostic-ignored-pragmas Diagnostic text:

      -
    • warning: format string is not a string literal (potentially insecure)
    • +
    • warning: #pragma %0(pop, ...) failed: %1
    • +
    • warning: #pragma options align=reset failed: %0
    • +
    • warning: %0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1
    • +
    • warning: %select{value|type}0-dependent expression passed as an argument to debug command
    • +
    • warning: '#pragma %0' is not supported on this target - ignored
    • +
    • warning: '#pragma comment %0' ignored
    • +
    • warning: '#pragma init_seg' is only supported when targeting a Microsoft environment
    • +
    • warning: OpenCL extension %0 unknown or does not require pragma - ignoring
    • +
    • warning: expected #pragma pack parameter to be '1', '2', '4', '8', or '16'
    • +
    • warning: expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring
    • +
    • warning: expected '#pragma unused' argument to be a variable name
    • +
    • warning: expected ')' or ',' in '#pragma %0'
    • +
    • warning: expected ',' in '#pragma %0'
    • +
    • warning: expected '=' following '#pragma %select{align|options align}0' - ignored
    • +
    • warning: expected 'align' following '#pragma options' - ignored
    • +
    • warning: expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored
    • +
    • warning: expected a stack label or a string literal for the section name in '#pragma %0' - ignored
    • +
    • warning: expected a string literal for the section name in '#pragma %0' - ignored
    • +
    • warning: expected action or ')' in '#pragma %0' - ignored
    • +
    • warning: expected identifier in '#pragma %0' - ignored
    • +
    • warning: expected integer between %0 and %1 inclusive in '#pragma %2' - ignored
    • +
    • warning: expected integer or identifier in '#pragma pack' - ignored
    • +
    • warning: expected non-wide string literal in '#pragma %0'
    • +
    • warning: expected push, pop or a string literal for the section name in '#pragma %0' - ignored
    • +
    • warning: expected string literal in '#pragma %0' - ignoring
    • +
    • warning: expected string literal in 'clause %0' - ignoring
    • +
    • warning: extra tokens at end of '#pragma %0' - ignored
    • +
    • warning: incorrect use of #pragma clang force_cuda_host_device begin|end
    • +
    • warning: incorrect use of '#pragma fenv_access (on|off)' - ignored
    • +
    • warning: incorrect use of '#pragma ms_struct on|off' - ignored
    • +
    • warning: invalid alignment option in '#pragma %select{align|options align}0' - ignored
    • +
    • warning: invalid or unsupported rounding mode in '#pragma STDC FENV_ROUND' - ignored
    • +
    • warning: known but unsupported action '%1' for '#pragma %0' - ignored
    • +
    • warning: missing '(' after '#pragma %0' - ignoring
    • +
    • warning: missing ')' after '#pragma %0' - ignoring
    • +
    • warning: missing ':' after %0 - ignoring
    • +
    • warning: missing ':' or ')' after %0 - ignoring
    • +
    • warning: missing argument to '#pragma %0'%select{|; expected %2}1
    • +
    • warning: missing argument to debug command '%0'
    • +
    • warning: missing debug command
    • +
    • warning: only variables can be arguments to '#pragma unused'
    • +
    • warning: pragma pop_macro could not pop '%0', no matching push_macro
    • +
    • warning: undeclared variable %0 used as an argument for '#pragma unused'
    • +
    • warning: unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2
    • +
    • warning: unexpected argument to debug command
    • +
    • warning: unexpected debug command '%0'
    • +
    • warning: unknown action '%1' for '#pragma %0' - ignored
    • +
    • warning: unknown action for '#pragma %0' - ignored
    • +
    • warning: unknown module '%0'
    • +
    • warning: unsupported OpenCL extension %0 - ignoring

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-type-confusion - clang-diagnostic-format-type-confusion + clang-diagnostic-ignored-qualifiers + clang-diagnostic-ignored-qualifiers Diagnostic text:

      -
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1
    • +
    • warning: '%0' qualifier on function type %1 has no effect
    • +
    • warning: '%0' qualifier on omitted return type %1 has no effect
    • +
    • warning: '%0' qualifier on reference type %1 has no effect
    • +
    • warning: '%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect
    • +
    • warning: ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 lifetime qualifier on return type is ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-format-zero-length - clang-diagnostic-format-zero-length + clang-diagnostic-ignored-reference-qualifiers + clang-diagnostic-ignored-reference-qualifiers Diagnostic text:

      -
    • warning: format string is empty
    • +
    • warning: '%0' qualifier on reference type %1 has no effect

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-fortify-source - clang-diagnostic-fortify-source + clang-diagnostic-implicit + clang-diagnostic-implicit Diagnostic text:

      -
    • warning: '%0' may overflow; destination buffer in argument %1 has size %2, but the corresponding specifier may require size %3
    • -
    • warning: '%0' size argument is too large; destination buffer has size %1, but size argument is %2
    • -
    • warning: '%0' will always overflow; destination buffer has size %1, but format string expands to at least %2
    • -
    • warning: '%0' will always overflow; destination buffer has size %1, but size argument is %2
    • -
    • warning: '%0' will always overflow; destination buffer has size %1, but the source string has length %2 (including NUL byte)
    • +
    • warning: call to undeclared function %0; ISO C99 and later do not support implicit function declarations
    • +
    • warning: call to undeclared library function '%0' with type %1; ISO C99 and later do not support implicit function declarations
    • +
    • warning: implicit declaration of function %0
    • +
    • warning: implicitly declaring library function '%0' with type %1
    • +
    • warning: parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not support implicit int
    • +
    • warning: type specifier missing, defaults to 'int'
    • +
    • warning: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int
    • +
    • warning: use of unknown builtin %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-receiver-forward-class - clang-diagnostic-receiver-forward-class + clang-diagnostic-implicit-atomic-properties + clang-diagnostic-implicit-atomic-properties Diagnostic text:

      -
    • warning: receiver %0 is a forward class and corresponding @interface may not exist
    • -
    • warning: receiver type %0 for instance message is a forward declaration
    • +
    • warning: property is assumed atomic by default
    • +
    • warning: property is assumed atomic when auto-synthesizing the property

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-four-char-constants - clang-diagnostic-four-char-constants + clang-diagnostic-implicit-const-int-float-conversion + clang-diagnostic-implicit-const-int-float-conversion Diagnostic text:

      -
    • warning: multi-character character constant
    • +
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-frame-address - clang-diagnostic-frame-address + clang-diagnostic-implicit-conversion-floating-point-to-bool + clang-diagnostic-implicit-conversion-floating-point-to-bool Diagnostic text:

      -
    • warning: calling '%0' with a nonzero argument is unsafe
    • +
    • warning: implicit conversion turns floating-point number into bool: %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-atimport-in-framework-header - clang-diagnostic-atimport-in-framework-header + clang-diagnostic-implicit-fallthrough + clang-diagnostic-implicit-fallthrough Diagnostic text:

      -
    • warning: use of '@import' in framework header is discouraged, including this header requires -fmodules
    • +
    • warning: unannotated fall-through between switch labels
    • +
    • warning: unannotated fall-through between switch labels in partly-annotated function

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-quoted-include-in-framework-header - clang-diagnostic-quoted-include-in-framework-header + clang-diagnostic-implicit-fallthrough-per-function + clang-diagnostic-implicit-fallthrough-per-function Diagnostic text:

      -
    • warning: double-quoted include "%0" in framework header, expected angle-bracketed instead
    • +
    • warning: unannotated fall-through between switch labels in partly-annotated function

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-framework-include-private-from-public - clang-diagnostic-framework-include-private-from-public + clang-diagnostic-implicit-fixed-point-conversion + clang-diagnostic-implicit-fixed-point-conversion Diagnostic text:

      -
    • warning: public framework header includes private framework header '%0'
    • +
    • warning: implicit conversion from %0 cannot fit within the range of values for %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-free-nonheap-object - clang-diagnostic-free-nonheap-object + clang-diagnostic-implicit-float-conversion + clang-diagnostic-implicit-float-conversion Diagnostic text:

      -
    • warning: attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1
    • +
    • warning: implicit conversion from %0 to %1 may lose precision
    • +
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • +
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • +
    • warning: implicit conversion loses floating-point precision: %0 to %1
    • +
    • warning: implicit conversion when assigning computation result loses floating-point precision: %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-function-def-in-objc-container - clang-diagnostic-function-def-in-objc-container + clang-diagnostic-implicit-function-declaration + clang-diagnostic-implicit-function-declaration Diagnostic text:

      -
    • warning: function definition inside an Objective-C container is deprecated
    • +
    • warning: call to undeclared function %0; ISO C99 and later do not support implicit function declarations
    • +
    • warning: call to undeclared library function '%0' with type %1; ISO C99 and later do not support implicit function declarations
    • +
    • warning: implicit declaration of function %0
    • +
    • warning: implicitly declaring library function '%0' with type %1
    • +
    • warning: use of unknown builtin %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-function-multiversion - clang-diagnostic-function-multiversion + clang-diagnostic-implicit-int + clang-diagnostic-implicit-int Diagnostic text:

      -
    • warning: CPU list contains duplicate entries; attribute ignored
    • -
    • warning: body of cpu_dispatch function will be ignored
    • -
    • warning: mixing 'target_clones' specifier mechanisms is permitted for GCC compatibility; use a comma separated sequence of string literals, or a string literal containing a comma-separated list of versions
    • -
    • warning: version list contains duplicate entries
    • +
    • warning: parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not support implicit int
    • +
    • warning: type specifier missing, defaults to 'int'
    • +
    • warning: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-future-attribute-extensions - clang-diagnostic-future-attribute-extensions + clang-diagnostic-implicit-int-conversion + clang-diagnostic-implicit-int-conversion Diagnostic text:

      -
    • warning: use of the %0 attribute is a C++14 extension
    • -
    • warning: use of the %0 attribute is a C++17 extension
    • -
    • warning: use of the %0 attribute is a C++20 extension
    • +
    • warning: higher order bits are zeroes after implicit conversion
    • +
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • +
    • warning: implicit conversion loses integer precision: %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-write-strings - clang-diagnostic-write-strings + clang-diagnostic-implicit-int-float-conversion + clang-diagnostic-implicit-int-float-conversion Diagnostic text:

      -
    • warning: ISO C++11 does not allow conversion from string literal to %0
    • -
    • warning: conversion from string literal to %0 is deprecated
    • +
    • warning: implicit conversion from %0 to %1 may lose precision
    • +
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu - clang-diagnostic-gnu + clang-diagnostic-implicitly-unsigned-literal + clang-diagnostic-implicitly-unsigned-literal Diagnostic text:

      -
    • warning: #include_next is a language extension
    • -
    • warning: #line directive with zero argument is a GNU extension
    • -
    • warning: %0 applied to an expression is a GNU extension
    • -
    • warning: %select{struct|union}0 without named members is a GNU extension
    • -
    • warning: '__auto_type' is a GNU extension
    • -
    • warning: anonymous structs are a GNU extension
    • -
    • warning: binary integer literals are a GNU extension
    • -
    • warning: cast to union type is a GNU extension
    • -
    • warning: class member cannot be redeclared
    • -
    • warning: complex integer types are a GNU extension
    • -
    • warning: empty %select{struct|union}0 is a GNU extension
    • -
    • warning: expression is not an %select{integer|integral}0 constant expression; folding it to a constant is a GNU extension
    • -
    • warning: field %0 with variable sized type %1 not at the end of a struct or class is a GNU extension
    • -
    • warning: flexible array initialization is a GNU extension
    • -
    • warning: flexible array member %0 in a union is a GNU extension
    • -
    • warning: flexible array member %0 in otherwise empty %select{struct|interface|union|class|enum}1 is a GNU extension
    • -
    • warning: imaginary constants are a GNU extension
    • -
    • warning: in-class initializer for static data member is not a constant expression; folding it to a constant is a GNU extension
    • -
    • warning: in-class initializer for static data member of type %0 is a GNU extension
    • -
    • warning: initialization of an array %diff{of type $ from a compound literal of type $|from a compound literal}0,1 is a GNU extension
    • -
    • warning: must specify at least one argument for '...' parameter of variadic macro
    • -
    • warning: redeclaration of already-defined enum %0 is a GNU extension
    • -
    • warning: string literal operator templates are a GNU extension
    • -
    • warning: token pasting of ',' and __VA_ARGS__ is a GNU extension
    • -
    • warning: use of GNU 'missing =' extension in designator
    • -
    • warning: use of GNU ?: conditional expression extension, omitting middle operand
    • -
    • warning: use of GNU address-of-label extension
    • -
    • warning: use of GNU array range extension
    • -
    • warning: use of GNU case range extension
    • -
    • warning: use of GNU empty initializer extension
    • -
    • warning: use of GNU indirect-goto extension
    • -
    • warning: use of GNU old-style field designator extension
    • -
    • warning: use of GNU statement expression extension
    • -
    • warning: variable length array folded to constant array as an extension
    • -
    • warning: variable length arrays are a C99 feature
    • -
    • warning: zero size arrays are an extension
    • +
    • warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-alignof-expression - clang-diagnostic-gnu-alignof-expression + clang-diagnostic-incompatible-exception-spec + clang-diagnostic-incompatible-exception-spec Diagnostic text:

      -
    • warning: %0 applied to an expression is a GNU extension
    • +
    • warning: exception specifications of %select{return|argument}0 types differ
    • +
    • warning: target exception specification is not superset of source

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-anonymous-struct - clang-diagnostic-gnu-anonymous-struct + clang-diagnostic-incompatible-function-pointer-types + clang-diagnostic-incompatible-function-pointer-types Diagnostic text:

      -
    • warning: anonymous structs are a GNU extension
    • +
    • warning: incompatible function pointer types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-gnu-auto-type - clang-diagnostic-gnu-auto-type + clang-diagnostic-incompatible-ms-pragma-section + clang-diagnostic-incompatible-ms-pragma-section Diagnostic text:

      -
    • warning: '__auto_type' is a GNU extension
    • +
    • warning: `#pragma const_seg` for section %1 will not apply to %0 due to the presence of a %select{mutable field||non-trivial constructor|non-trivial destructor}2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-binary-literal - clang-diagnostic-gnu-binary-literal + clang-diagnostic-incompatible-ms-struct + clang-diagnostic-incompatible-ms-struct Diagnostic text:

      -
    • warning: binary integer literals are a GNU extension
    • +
    • warning: ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions
    • +
    • warning: ms_struct may not produce Microsoft-compatible layouts with fundamental data types with sizes that aren't a power of two

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-gnu-case-range - clang-diagnostic-gnu-case-range + clang-diagnostic-incompatible-pointer-types + clang-diagnostic-incompatible-pointer-types Diagnostic text:

      -
    • warning: use of GNU case range extension
    • +
    • warning: %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2 discards qualifiers
    • +
    • warning: %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2 discards qualifiers in nested pointer types
    • +
    • warning: %select{reinterpret_cast|C-style cast}0 from %1 to %2 changes address space of nested pointers
    • +
    • warning: incompatible function pointer types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: incompatible pointer types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-gnu-complex-integer - clang-diagnostic-gnu-complex-integer + clang-diagnostic-incompatible-pointer-types-discards-qualifiers + clang-diagnostic-incompatible-pointer-types-discards-qualifiers Diagnostic text:

      -
    • warning: complex integer types are a GNU extension
    • +
    • warning: %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2 discards qualifiers
    • +
    • warning: %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2 discards qualifiers in nested pointer types
    • +
    • warning: %select{reinterpret_cast|C-style cast}0 from %1 to %2 changes address space of nested pointers

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-compound-literal-initializer - clang-diagnostic-gnu-compound-literal-initializer + clang-diagnostic-incomplete-framework-module-declaration + clang-diagnostic-incomplete-framework-module-declaration Diagnostic text:

      -
    • warning: initialization of an array %diff{of type $ from a compound literal of type $|from a compound literal}0,1 is a GNU extension
    • +
    • warning: skipping '%0' because module declaration of '%1' lacks the 'framework' qualifier

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-conditional-omitted-operand - clang-diagnostic-gnu-conditional-omitted-operand + clang-diagnostic-incomplete-module + clang-diagnostic-incomplete-module Diagnostic text:

      -
    • warning: use of GNU ?: conditional expression extension, omitting middle operand
    • +
    • warning: include of non-modular header inside framework module '%0': '%1'
    • +
    • warning: include of non-modular header inside module '%0': '%1'
    • +
    • warning: missing submodule '%0'
    • +
    • warning: umbrella directory '%0' not found
    • +
    • warning: umbrella header for module '%0' does not include header '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-designator - clang-diagnostic-gnu-designator + clang-diagnostic-incomplete-umbrella + clang-diagnostic-incomplete-umbrella Diagnostic text:

      -
    • warning: use of GNU 'missing =' extension in designator
    • -
    • warning: use of GNU array range extension
    • -
    • warning: use of GNU old-style field designator extension
    • +
    • warning: missing submodule '%0'
    • +
    • warning: umbrella directory '%0' not found
    • +
    • warning: umbrella header for module '%0' does not include header '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-empty-initializer - clang-diagnostic-gnu-empty-initializer + clang-diagnostic-increment-bool + clang-diagnostic-increment-bool Diagnostic text:

      -
    • warning: use of GNU empty initializer extension
    • +
    • warning: ISO C++17 does not allow incrementing expression of type bool
    • +
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-gnu-empty-struct - clang-diagnostic-gnu-empty-struct + clang-diagnostic-IndependentClass-attribute + clang-diagnostic-IndependentClass-attribute Diagnostic text:

      -
    • warning: %select{struct|union}0 without named members is a GNU extension
    • -
    • warning: empty %select{struct|union}0 is a GNU extension
    • -
    • warning: flexible array member %0 in otherwise empty %select{struct|interface|union|class|enum}1 is a GNU extension
    • +
    • warning: 'objc_independent_class' attribute may be put on Objective-C object pointer type only; attribute is ignored
    • +
    • warning: 'objc_independent_class' attribute may be put on a typedef only; attribute is ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-flexible-array-initializer - clang-diagnostic-gnu-flexible-array-initializer + clang-diagnostic-infinite-recursion + clang-diagnostic-infinite-recursion Diagnostic text:

      -
    • warning: flexible array initialization is a GNU extension
    • +
    • warning: all paths through this function will call itself

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-flexible-array-union-member - clang-diagnostic-gnu-flexible-array-union-member + clang-diagnostic-initializer-overrides + clang-diagnostic-initializer-overrides Diagnostic text:

      -
    • warning: flexible array member %0 in a union is a GNU extension
    • +
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • +
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • +
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-gnu-folding-constant - clang-diagnostic-gnu-folding-constant + clang-diagnostic-inline-namespace-reopened-noninline + clang-diagnostic-inline-namespace-reopened-noninline Diagnostic text:

      -
    • warning: expression is not an %select{integer|integral}0 constant expression; folding it to a constant is a GNU extension
    • -
    • warning: in-class initializer for static data member is not a constant expression; folding it to a constant is a GNU extension
    • -
    • warning: variable length array folded to constant array as an extension
    • +
    • warning: inline namespace reopened as a non-inline namespace

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-imaginary-constant - clang-diagnostic-gnu-imaginary-constant + clang-diagnostic-int-conversion + clang-diagnostic-int-conversion Diagnostic text:

      -
    • warning: imaginary constants are a GNU extension
    • +
    • warning: incompatible integer to pointer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: incompatible pointer to integer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-gnu-include-next - clang-diagnostic-gnu-include-next + clang-diagnostic-int-in-bool-context + clang-diagnostic-int-in-bool-context Diagnostic text:

      -
    • warning: #include_next is a language extension
    • +
    • warning: converting the enum constant to a boolean
    • +
    • warning: converting the result of '<<' to a boolean; did you mean '(%0) != 0'?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-label-as-value - clang-diagnostic-gnu-label-as-value + clang-diagnostic-int-to-pointer-cast + clang-diagnostic-int-to-pointer-cast Diagnostic text:

      -
    • warning: use of GNU address-of-label extension
    • -
    • warning: use of GNU indirect-goto extension
    • +
    • warning: cast to %1 from smaller integer type %0
    • +
    • warning: cast to %1 from smaller integer type %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-redeclared-enum - clang-diagnostic-gnu-redeclared-enum + clang-diagnostic-int-to-void-pointer-cast + clang-diagnostic-int-to-void-pointer-cast Diagnostic text:

      -
    • warning: redeclaration of already-defined enum %0 is a GNU extension
    • +
    • warning: cast to %1 from smaller integer type %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-statement-expression - clang-diagnostic-gnu-statement-expression + clang-diagnostic-invalid-command-line-argument + clang-diagnostic-invalid-command-line-argument Diagnostic text:

      -
    • warning: use of GNU statement expression extension
    • +
    • warning: feature flag '%0' is ignored since the feature is read only
    • +
    • warning: feature flag '%0' must start with either '+' to enable the feature or '-' to disable it; flag ignored
    • +
    • warning: ignoring extension '%0' because the '%1' architecture does not support it
    • +
    • warning: mismatch between architecture and environment in target triple '%0'; did you mean '%1'?
    • +
    • warning: missing plugin argument for plugin %0 in %1
    • +
    • warning: missing plugin name in %0
    • +
    • warning: no MCU device specified, but '-mhwmult' is set to 'auto', assuming no hardware multiply; use '-mmcu' to specify an MSP430 device, or '-mhwmult' to set the hardware multiply type explicitly
    • +
    • warning: optimization flag '%0' is not supported
    • +
    • warning: optimization flag '%0' is not supported for target '%1'
    • +
    • warning: optimization level '%0' is not supported; using '%1%2' instead
    • +
    • warning: the given MCU does not support hardware multiply, but '-mhwmult' is set to %0
    • +
    • warning: the given MCU supports %0 hardware multiply, but '-mhwmult' is set to %1
    • +
    • warning: the object size sanitizer has no effect at -O0, but is explicitly enabled: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-static-float-init - clang-diagnostic-gnu-static-float-init + clang-diagnostic-invalid-ios-deployment-target + clang-diagnostic-invalid-ios-deployment-target Diagnostic text:

      -
    • warning: in-class initializer for static data member of type %0 is a GNU extension
    • +
    • warning: invalid iOS deployment version '%0', iOS 10 is the maximum deployment target for 32-bit targets

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-gnu-string-literal-operator-template - clang-diagnostic-gnu-string-literal-operator-template + clang-diagnostic-invalid-noreturn + clang-diagnostic-invalid-noreturn Diagnostic text:

      -
    • warning: string literal operator templates are a GNU extension
    • +
    • warning: function %0 declared 'noreturn' should not return
    • +
    • warning: function declared 'noreturn' should not return

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-union-cast - clang-diagnostic-gnu-union-cast + clang-diagnostic-invalid-offsetof + clang-diagnostic-invalid-offsetof Diagnostic text:

      -
    • warning: cast to union type is a GNU extension
    • +
    • warning: offset of on non-POD type %0
    • +
    • warning: offset of on non-standard-layout type %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-variable-sized-type-not-at-end - clang-diagnostic-gnu-variable-sized-type-not-at-end + clang-diagnostic-invalid-or-nonexistent-directory + clang-diagnostic-invalid-or-nonexistent-directory Diagnostic text:

      -
    • warning: field %0 with variable sized type %1 not at the end of a struct or class is a GNU extension
    • +
    • warning: unable to find %0 directory, expected to be in '%1' found via %2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-zero-line-directive - clang-diagnostic-gnu-zero-line-directive + clang-diagnostic-invalid-pp-token + clang-diagnostic-invalid-pp-token Diagnostic text:

      -
    • warning: #line directive with zero argument is a GNU extension
    • +
    • warning: empty character constant
    • +
    • warning: missing terminating %select{'|'"'}0 character

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gnu-zero-variadic-macro-arguments - clang-diagnostic-gnu-zero-variadic-macro-arguments + clang-diagnostic-invalid-source-encoding + clang-diagnostic-invalid-source-encoding Diagnostic text:

      -
    • warning: must specify at least one argument for '...' parameter of variadic macro
    • -
    • warning: token pasting of ',' and __VA_ARGS__ is a GNU extension
    • +
    • warning: illegal character encoding in character literal
    • +
    • warning: illegal character encoding in string literal

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-gcc-compat - clang-diagnostic-gcc-compat + clang-diagnostic-knr-promoted-parameter + clang-diagnostic-knr-promoted-parameter Diagnostic text:

      -
    • warning: '%0' is bound to current loop, GCC binds it to the enclosing loop
    • -
    • warning: 'break' is bound to loop, GCC binds it to switch
    • -
    • warning: 'diagnose_if' is a clang extension
    • -
    • warning: 'enable_if' is a clang extension
    • -
    • warning: GCC does not allow %0 attribute in this position on a function definition
    • -
    • warning: GCC does not allow an attribute in this position on a function declaration
    • -
    • warning: GCC does not allow the %0 attribute to be written on a type
    • -
    • warning: GCC does not allow the 'cleanup' attribute argument to be anything other than a simple identifier
    • -
    • warning: GCC does not allow variable declarations in for loop initializers before C99
    • -
    • warning: __final is a GNU extension, consider using C++11 final
    • +
    • warning: %diff{promoted type $ of K&R function parameter is not compatible with the parameter type $|promoted type of K&R function parameter is not compatible with parameter type}0,1 declared in a previous prototype

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-global-constructors - clang-diagnostic-global-constructors + clang-diagnostic-keyword-macro + clang-diagnostic-keyword-macro Diagnostic text:

      -
    • warning: declaration requires a global constructor
    • -
    • warning: declaration requires a global destructor
    • +
    • warning: keyword is hidden by macro definition

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-global-isel - clang-diagnostic-global-isel + clang-diagnostic-keyword-compat + clang-diagnostic-keyword-compat Diagnostic text:

      -
    • warning: -fglobal-isel support for the '%0' architecture is incomplete
    • -
    • warning: -fglobal-isel support is incomplete for this architecture at the current optimization level
    • +
    • warning: keyword '%0' will be made available as an identifier %select{here|for the remainder of the translation unit}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-hip-only - clang-diagnostic-hip-only + clang-diagnostic-large-by-value-copy + clang-diagnostic-large-by-value-copy Diagnostic text:

      -
    • warning: '%0' is ignored since it is only supported for HIP
    • +
    • warning: %0 is a large (%1 bytes) pass-by-value argument; pass it by reference instead ?
    • +
    • warning: return value of %0 is a large (%1 bytes) pass-by-value object; pass it by reference instead ?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-header-hygiene - clang-diagnostic-header-hygiene + clang-diagnostic-linker-warnings + clang-diagnostic-linker-warnings Diagnostic text:

      -
    • warning: using namespace directive in global context in header
    • +
    • warning: linking module '%0': %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ignored-attributes - clang-diagnostic-ignored-attributes + clang-diagnostic-literal-conversion + clang-diagnostic-literal-conversion Diagnostic text:

      -
    • warning: %0 attribute argument not supported: %1
    • -
    • warning: %0 attribute can only be applied to instance variables or properties
    • -
    • warning: %0 attribute ignored
    • -
    • warning: %0 attribute ignored for field of type %1
    • -
    • warning: %0 attribute ignored on a non-definition declaration
    • -
    • warning: %0 attribute ignored on inline function
    • -
    • warning: %0 attribute ignored when parsing type
    • -
    • warning: %0 attribute is deprecated and ignored in %1
    • -
    • warning: %0 attribute is ignored because there exists no call expression inside the statement
    • -
    • warning: %0 attribute isn't implemented by this Objective-C runtime
    • -
    • warning: %0 attribute only applies to %1
    • -
    • warning: %0 attribute only applies to %select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters
    • -
    • warning: %0 attribute only applies to %select{functions|methods|properties}1 that return %select{an Objective-C object|a pointer|a non-retainable pointer}2
    • -
    • warning: %0 attribute only applies to %select{functions|unions|variables and functions|functions and methods|functions, methods and blocks|functions, methods, and parameters|variables|variables and fields|variables, data members and tag types|types and namespaces|variables, functions and classes|kernel functions|non-K&R-style functions}1
    • -
    • warning: %0 attribute only applies to a pointer or reference (%1 is invalid)
    • -
    • warning: %0 attribute only applies to return values that are pointers
    • -
    • warning: %0 attribute only applies to return values that are pointers or references
    • -
    • warning: %0 attribute only applies to%select{| constant}1 pointer arguments
    • -
    • warning: %0 calling convention is not supported %select{for this target|on variadic function|on constructor/destructor|on builtin function}1
    • -
    • warning: %0 currently has no effect on a using declaration
    • -
    • warning: %q0 redeclared inline; %1 attribute ignored
    • -
    • warning: %select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to functions that have %select{no parameters|a 'void' return type}1
    • -
    • warning: %select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2
    • -
    • warning: %select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden
    • -
    • warning: %select{alignment|size}0 of field %1 (%2 bits) does not match the %select{alignment|size}0 of the first field in transparent union; transparent_union attribute ignored
    • -
    • warning: %select{unsupported|duplicate|unknown}0%select{| architecture| tune CPU}1 '%2' in the '%select{target|target_clones}3' attribute string; '%select{target|target_clones}3' attribute ignored
    • -
    • warning: '%0' attribute cannot be specified on a definition
    • -
    • warning: '%0' only applies to %select{function|pointer|Objective-C object or block pointer}1 types; type here is %2
    • -
    • warning: '__clang__' is a predefined macro name, not an attribute scope specifier; did you mean '_Clang' instead?
    • -
    • warning: 'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored
    • -
    • warning: 'cmse_nonsecure_entry' cannot be applied to functions with internal linkage
    • -
    • warning: 'deprecated' attribute on anonymous namespace ignored
    • -
    • warning: 'dllexport' attribute ignored on explicit instantiation definition
    • -
    • warning: 'gnu_inline' attribute requires function to be marked 'inline', attribute ignored
    • -
    • warning: 'internal_linkage' attribute on a non-static local variable is ignored
    • -
    • warning: 'mig_server_routine' attribute only applies to routines that return a kern_return_t
    • -
    • warning: 'nocf_check' attribute ignored; use -fcf-protection to enable the attribute
    • -
    • warning: 'noderef' can only be used on an array or pointer type
    • -
    • warning: 'nonnull' attribute applied to function with no pointer arguments
    • -
    • warning: 'nonnull' attribute when used on parameters takes no arguments
    • -
    • warning: 'nothrow' attribute conflicts with exception specification; attribute ignored
    • -
    • warning: 'objc_externally_retained' can only be applied to local variables %select{of retainable type|with strong ownership}0
    • -
    • warning: 'require_constant_initialization' attribute added after initialization of variable
    • -
    • warning: 'sentinel' attribute only supported for variadic %select{functions|blocks}0
    • -
    • warning: 'sentinel' attribute requires named arguments
    • -
    • warning: 'sycl_kernel' attribute only applies to a function template with at least two template parameters
    • -
    • warning: 'trivial_abi' cannot be applied to %0
    • -
    • warning: Objective-C GC does not allow weak variables on the stack
    • -
    • warning: __declspec attribute %0 is not supported
    • -
    • warning: __weak attribute cannot be specified on a field declaration
    • -
    • warning: __weak attribute cannot be specified on an automatic variable when ARC is not enabled
    • -
    • warning: attribute %0 after definition is ignored
    • -
    • warning: attribute %0 cannot be applied to %select{functions|Objective-C method}1 without return value
    • -
    • warning: attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement
    • -
    • warning: attribute %0 has no effect when annotating an infinite loop
    • -
    • warning: attribute %0 ignored, because it cannot be applied to a type
    • -
    • warning: attribute %0 ignored, because it cannot be applied to omitted return type
    • -
    • warning: attribute %0 ignored, because it is not attached to a declaration
    • -
    • warning: attribute %0 is already applied
    • -
    • warning: attribute %0 is already applied with different arguments
    • -
    • warning: attribute %0 is ignored, place it after "%select{class|struct|interface|union|enum}1" to apply attribute to type declaration
    • -
    • warning: attribute declaration must precede definition
    • -
    • warning: conflicting attributes %0 are ignored
    • -
    • warning: direct attribute on property %0 ignored (not implemented by this Objective-C runtime)
    • -
    • warning: first field of a transparent union cannot have %select{floating point|vector}0 type %1; transparent_union attribute ignored
    • -
    • warning: function template with 'sycl_kernel' attribute must have a 'void' return type
    • -
    • warning: function template with 'sycl_kernel' attribute must have a single parameter
    • -
    • warning: ignoring __declspec(allocator) because the function return type %0 is not a pointer or reference type
    • -
    • warning: import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the previous declaration
    • -
    • warning: import %select{module|name}0 cannot be applied to a function with a definition
    • -
    • warning: inheritance model ignored on %select{primary template|partial specialization}0
    • -
    • warning: qualifiers after comma in declarator list are ignored
    • -
    • warning: repeated RISC-V 'interrupt' attribute
    • -
    • warning: requested alignment is less than minimum alignment of %1 for type %0
    • -
    • warning: template parameter of a function template with the 'sycl_kernel' attribute cannot be a non-type template parameter
    • -
    • warning: transparent union definition must contain at least one field; transparent_union attribute ignored
    • -
    • warning: transparent_union attribute can only be applied to a union definition; attribute ignored
    • -
    • warning: unknown attribute '%0'
    • -
    • warning: unknown visibility %0
    • +
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • +
    • warning: implicit conversion of out of range value from %0 to %1 is undefined

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ignored-optimization-argument - clang-diagnostic-ignored-optimization-argument + clang-diagnostic-literal-range + clang-diagnostic-literal-range Diagnostic text:

      -
    • warning: optimization flag '%0' is not supported
    • -
    • warning: optimization flag '%0' is not supported for target '%1'
    • +
    • warning: floating-point comparison is always %select{true|false}0; constant cannot be represented exactly in type %1
    • +
    • warning: magnitude of floating-point constant too large for type %0; maximum is %1
    • +
    • warning: magnitude of floating-point constant too small for type %0; minimum is %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ignored-pragma-intrinsic - clang-diagnostic-ignored-pragma-intrinsic + clang-diagnostic-local-type-template-args + clang-diagnostic-local-type-template-args Diagnostic text:

      -
    • warning: %0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1
    • +
    • warning: local type %0 as template argument is incompatible with C++98
    • +
    • warning: template argument uses local type %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ignored-pragma-optimize - clang-diagnostic-ignored-pragma-optimize + clang-diagnostic-logical-not-parentheses + clang-diagnostic-logical-not-parentheses Diagnostic text:

      -
    • warning: '#pragma optimize' is not supported
    • +
    • warning: logical not is only applied to the left hand side of this %select{comparison|bitwise operator}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ignored-pragmas - clang-diagnostic-ignored-pragmas + clang-diagnostic-logical-op-parentheses + clang-diagnostic-logical-op-parentheses Diagnostic text:

      -
    • warning: #pragma %0(pop, ...) failed: %1
    • -
    • warning: #pragma options align=reset failed: %0
    • -
    • warning: %0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1
    • -
    • warning: '#pragma %0' is not supported on this target - ignored
    • -
    • warning: '#pragma comment %0' ignored
    • -
    • warning: '#pragma init_seg' is only supported when targeting a Microsoft environment
    • -
    • warning: '#pragma optimize' is not supported
    • -
    • warning: expected #pragma pack parameter to be '1', '2', '4', '8', or '16'
    • -
    • warning: expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring
    • -
    • warning: expected '#pragma unused' argument to be a variable name
    • -
    • warning: expected ')' or ',' in '#pragma %0'
    • -
    • warning: expected ',' in '#pragma %0'
    • -
    • warning: expected '=' following '#pragma %select{align|options align}0' - ignored
    • -
    • warning: expected 'align' following '#pragma options' - ignored
    • -
    • warning: expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored
    • -
    • warning: expected a stack label or a string literal for the section name in '#pragma %0' - ignored
    • -
    • warning: expected a string literal for the section name in '#pragma %0' - ignored
    • -
    • warning: expected action or ')' in '#pragma %0' - ignored
    • -
    • warning: expected identifier in '#pragma %0' - ignored
    • -
    • warning: expected integer between %0 and %1 inclusive in '#pragma %2' - ignored
    • -
    • warning: expected integer or identifier in '#pragma pack' - ignored
    • -
    • warning: expected non-wide string literal in '#pragma %0'
    • -
    • warning: expected push, pop or a string literal for the section name in '#pragma %0' - ignored
    • -
    • warning: expected string literal in '#pragma %0' - ignoring
    • -
    • warning: extra tokens at end of '#pragma %0' - ignored
    • -
    • warning: incorrect use of #pragma clang force_cuda_host_device begin|end
    • -
    • warning: incorrect use of '#pragma fenv_access (on|off)' - ignored
    • -
    • warning: incorrect use of '#pragma ms_struct on|off' - ignored
    • -
    • warning: invalid alignment option in '#pragma %select{align|options align}0' - ignored
    • -
    • warning: invalid or unsupported rounding mode in '#pragma STDC FENV_ROUND' - ignored
    • -
    • warning: known but unsupported action '%1' for '#pragma %0' - ignored
    • -
    • warning: missing '(' after '#pragma %0' - ignoring
    • -
    • warning: missing ')' after '#pragma %0' - ignoring
    • -
    • warning: missing ':' after %0 - ignoring
    • -
    • warning: missing ':' or ')' after %0 - ignoring
    • -
    • warning: missing argument to '#pragma %0'%select{|; expected %2}1
    • -
    • warning: missing argument to debug command '%0'
    • -
    • warning: only variables can be arguments to '#pragma unused'
    • -
    • warning: pragma pop_macro could not pop '%0', no matching push_macro
    • -
    • warning: undeclared variable %0 used as an argument for '#pragma unused'
    • -
    • warning: unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2
    • -
    • warning: unexpected debug command '%0'
    • -
    • warning: unknown OpenCL extension %0 - ignoring
    • -
    • warning: unknown action '%1' for '#pragma %0' - ignored
    • -
    • warning: unknown action for '#pragma %0' - ignored
    • -
    • warning: unknown module '%0'
    • -
    • warning: unsupported OpenCL extension %0 - ignoring
    • +
    • warning: '&&' within '||'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ignored-qualifiers - clang-diagnostic-ignored-qualifiers + clang-diagnostic-long-long + clang-diagnostic-long-long Diagnostic text:

      -
    • warning: '%0' qualifier on function type %1 has no effect
    • -
    • warning: '%0' qualifier on omitted return type %1 has no effect
    • -
    • warning: '%0' qualifier on reference type %1 has no effect
    • -
    • warning: '%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect
    • -
    • warning: ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 lifetime qualifier on return type is ignored
    • +
    • warning: 'long long' is a C++11 extension
    • +
    • warning: 'long long' is an extension when C99 mode is not enabled

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ignored-reference-qualifiers - clang-diagnostic-ignored-reference-qualifiers + clang-diagnostic-loop-analysis + clang-diagnostic-loop-analysis Diagnostic text:

      -
    • warning: '%0' qualifier on reference type %1 has no effect
    • +
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • +
    • warning: loop variable %0 binds to a temporary value produced by a range of type %1
    • +
    • warning: loop variable %0 creates a copy from type %1
    • +
    • warning: variable %0 is %select{decremented|incremented}1 both in the loop header and in the loop body
    • +
    • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit - clang-diagnostic-implicit + clang-diagnostic-macro-redefined + clang-diagnostic-macro-redefined Diagnostic text:

      -
    • warning: implicit declaration of function %0
    • -
    • warning: implicit declaration of function %0 is invalid in C99
    • -
    • warning: implicitly declaring library function '%0' with type %1
    • -
    • warning: type specifier missing, defaults to 'int'
    • -
    • warning: use of unknown builtin %0
    • +
    • warning: %0 macro redefined

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-implicit-atomic-properties - clang-diagnostic-implicit-atomic-properties + clang-diagnostic-main + clang-diagnostic-main Diagnostic text:

      -
    • warning: property is assumed atomic by default
    • -
    • warning: property is assumed atomic when auto-synthesizing the property
    • +
    • warning: 'main' is not allowed to be declared _Noreturn
    • +
    • warning: 'main' is not allowed to be declared variadic
    • +
    • warning: 'main' should not be declared static
    • +
    • warning: ISO C++ does not allow 'main' to be used by a program
    • +
    • warning: bool literal returned from 'main'
    • +
    • warning: only one parameter on 'main' declaration
    • +
    • warning: variable named 'main' with external linkage has undefined behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-const-int-float-conversion - clang-diagnostic-implicit-const-int-float-conversion + clang-diagnostic-main-return-type + clang-diagnostic-main-return-type Diagnostic text:

      -
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • +
    • warning: return type of 'main' is not 'int'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-conversion-floating-point-to-bool - clang-diagnostic-implicit-conversion-floating-point-to-bool + clang-diagnostic-malformed-warning-check + clang-diagnostic-malformed-warning-check Diagnostic text:

      -
    • warning: implicit conversion turns floating-point number into bool: %0 to %1
    • +
    • warning: __has_warning expected option name (e.g. "-Wundef")

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-fallthrough - clang-diagnostic-implicit-fallthrough + clang-diagnostic-max-tokens + clang-diagnostic-max-tokens Diagnostic text:

      -
    • warning: unannotated fall-through between switch labels
    • -
    • warning: unannotated fall-through between switch labels in partly-annotated function
    • +
    • warning: the number of preprocessor source tokens (%0) exceeds this token limit (%1)
    • +
    • warning: the total number of preprocessor source tokens (%0) exceeds the token limit (%1)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-fallthrough-per-function - clang-diagnostic-implicit-fallthrough-per-function + clang-diagnostic-max-unsigned-zero + clang-diagnostic-max-unsigned-zero Diagnostic text:

      -
    • warning: unannotated fall-through between switch labels in partly-annotated function
    • +
    • warning: taking the max of %select{a value and unsigned zero|unsigned zero and a value}0 is always equal to the other value

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-fixed-point-conversion - clang-diagnostic-implicit-fixed-point-conversion + clang-diagnostic-memset-transposed-args + clang-diagnostic-memset-transposed-args Diagnostic text:

      -
    • warning: implicit conversion from %0 cannot fit within the range of values for %1
    • +
    • warning: %select{'size' argument to memset is '0'|setting buffer to a 'sizeof' expression}0; did you mean to transpose the last two arguments?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-float-conversion - clang-diagnostic-implicit-float-conversion + clang-diagnostic-objc-method-access + clang-diagnostic-objc-method-access Diagnostic text:

      -
    • warning: implicit conversion from %0 to %1 may lose precision
    • -
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • -
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • -
    • warning: implicit conversion loses floating-point precision: %0 to %1
    • -
    • warning: implicit conversion when assigning computation result loses floating-point precision: %0 to %1
    • +
    • warning: class method %objcclass0 not found (return type defaults to 'id')
    • +
    • warning: class method %objcclass0 not found (return type defaults to 'id'); did you mean %objcclass2?
    • +
    • warning: instance method %0 found instead of class method %1
    • +
    • warning: instance method %0 is being used on 'Class' which is not in the root class
    • +
    • warning: instance method %objcinstance0 not found (return type defaults to 'id')
    • +
    • warning: instance method %objcinstance0 not found (return type defaults to 'id'); did you mean %objcinstance2?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-function-declaration - clang-diagnostic-implicit-function-declaration + clang-diagnostic-duplicate-method-match + clang-diagnostic-duplicate-method-match Diagnostic text:

      -
    • warning: implicit declaration of function %0
    • -
    • warning: implicit declaration of function %0 is invalid in C99
    • -
    • warning: implicitly declaring library function '%0' with type %1
    • -
    • warning: use of unknown builtin %0
    • +
    • warning: multiple declarations of method %0 found and ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-implicit-int - clang-diagnostic-implicit-int + clang-diagnostic-method-signatures + clang-diagnostic-method-signatures Diagnostic text:

      -
    • warning: type specifier missing, defaults to 'int'
    • +
    • warning: conflicting parameter types in implementation of %0: %1 vs %2
    • +
    • warning: conflicting return type in implementation of %0: %1 vs %2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-int-conversion - clang-diagnostic-implicit-int-conversion + clang-diagnostic-microsoft + clang-diagnostic-microsoft Diagnostic text:

      -
    • warning: higher order bits are zeroes after implicit conversion
    • -
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • -
    • warning: implicit conversion loses integer precision: %0 to %1
    • +
    • warning: #include resolved using non-portable Microsoft search rules as: %0
    • +
    • warning: #pragma %0(".drectve") has undefined behavior, use #pragma comment(linker, ...) instead
    • +
    • warning: %q0 redeclared without %1 attribute: previous %1 ignored
    • +
    • warning: %q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added
    • +
    • warning: %select{class template|class template partial|variable template|variable template partial|function template|member function|static data member|member class|member enumeration}0 specialization of %1 not in %select{a namespace enclosing %2|class %2 or an enclosing namespace}3 is a Microsoft extension
    • +
    • warning: %select{|pointer to |reference to }0incomplete type %1 is not allowed in exception specification
    • +
    • warning: 'abstract' keyword is a Microsoft extension
    • +
    • warning: 'mutable' on a reference type is a Microsoft extension
    • +
    • warning: 'sealed' keyword is a Microsoft extension
    • +
    • warning: 'static' can only be specified inside the class definition
    • +
    • warning: C++ operator %0 (aka %1) used as a macro name
    • +
    • warning: anonymous %select{structs|unions}0 are a Microsoft extension
    • +
    • warning: charizing operator #@ is a Microsoft extension
    • +
    • warning: declaration of %0 shadows template parameter
    • +
    • warning: default initialization of an object of const type %0%select{| without a user-provided default constructor}1 is a Microsoft extension
    • +
    • warning: duplicate explicit instantiation of %0 ignored as a Microsoft extension
    • +
    • warning: enumeration types with a fixed underlying type are a Microsoft extension
    • +
    • warning: enumerator value is not representable in the underlying type %0
    • +
    • warning: exception specification in declaration does not match previous declaration
    • +
    • warning: exception specification in explicit instantiation does not match instantiated one
    • +
    • warning: exception specification of '...' is a Microsoft extension
    • +
    • warning: exception specification of overriding function is more lax than base version
    • +
    • warning: expansion of predefined identifier '%0' to a string literal is a Microsoft extension
    • +
    • warning: explicit constructor calls are a Microsoft extension
    • +
    • warning: extra qualification on member %0
    • +
    • warning: flexible array member %0 in a union is a Microsoft extension
    • +
    • warning: flexible array member %0 in otherwise empty %select{struct|interface|union|class|enum}1 is a Microsoft extension
    • +
    • warning: forward references to 'enum' types are a Microsoft extension
    • +
    • warning: function definition with pure-specifier is a Microsoft extension
    • +
    • warning: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension
    • +
    • warning: initializing an array from a '%0' predefined identifier is a Microsoft extension
    • +
    • warning: jump from this goto statement to its label is a Microsoft extension
    • +
    • warning: non-type template argument containing a dereference operation is a Microsoft extension
    • +
    • warning: pasting two '/' tokens into a '//' comment is a Microsoft extension
    • +
    • warning: pseudo-destructors on type void are a Microsoft extension
    • +
    • warning: redeclaring non-static %0 as static is a Microsoft extension
    • +
    • warning: redefinition of default argument
    • +
    • warning: static_cast between pointer-to-function and pointer-to-object is a Microsoft extension
    • +
    • warning: template argument for template type parameter must be a type; omitted 'typename' is a Microsoft extension
    • +
    • warning: treating Ctrl-Z as end-of-file is a Microsoft extension
    • +
    • warning: types declared in an anonymous %select{struct|union}0 are a Microsoft extension
    • +
    • warning: union member %0 has reference type %1, which is a Microsoft extension
    • +
    • warning: unqualified base initializer of class templates is a Microsoft extension
    • +
    • warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier
    • +
    • warning: use of 'static_assert' without inclusion of <assert.h> is a Microsoft extension
    • +
    • warning: use of member %0 before its declaration is a Microsoft extension
    • +
    • warning: use of member %0 found via unqualified lookup into dependent bases of class templates is a Microsoft extension
    • +
    • warning: use of undeclared identifier %0; unqualified lookup into dependent bases of class template %1 is a Microsoft extension
    • +
    • warning: using declaration referring to inaccessible member '%0' (which refers to accessible member '%1') is a Microsoft compatibility extension
    • +
    • warning: using the undeclared type %0 as a default template argument is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicit-int-float-conversion - clang-diagnostic-implicit-int-float-conversion + clang-diagnostic-microsoft-abstract + clang-diagnostic-microsoft-abstract Diagnostic text:

      -
    • warning: implicit conversion from %0 to %1 may lose precision
    • -
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • +
    • warning: 'abstract' keyword is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-implicitly-unsigned-literal - clang-diagnostic-implicitly-unsigned-literal + clang-diagnostic-microsoft-anon-tag + clang-diagnostic-microsoft-anon-tag Diagnostic text:

      -
    • warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned
    • +
    • warning: anonymous %select{structs|unions}0 are a Microsoft extension
    • +
    • warning: types declared in an anonymous %select{struct|union}0 are a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-incompatible-exception-spec - clang-diagnostic-incompatible-exception-spec + clang-diagnostic-microsoft-cast + clang-diagnostic-microsoft-cast Diagnostic text:

      -
    • warning: exception specifications of %select{return|argument}0 types differ
    • -
    • warning: target exception specification is not superset of source
    • +
    • warning: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension
    • +
    • warning: static_cast between pointer-to-function and pointer-to-object is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-incompatible-function-pointer-types - clang-diagnostic-incompatible-function-pointer-types + clang-diagnostic-microsoft-charize + clang-diagnostic-microsoft-charize Diagnostic text:

      -
    • warning: incompatible function pointer types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: charizing operator #@ is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-incompatible-ms-struct - clang-diagnostic-incompatible-ms-struct + clang-diagnostic-microsoft-comment-paste + clang-diagnostic-microsoft-comment-paste Diagnostic text:

      -
    • warning: ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions
    • -
    • warning: ms_struct may not produce Microsoft-compatible layouts with fundamental data types with sizes that aren't a power of two
    • +
    • warning: pasting two '/' tokens into a '//' comment is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-incompatible-pointer-types - clang-diagnostic-incompatible-pointer-types + clang-diagnostic-microsoft-const-init + clang-diagnostic-microsoft-const-init Diagnostic text:

      -
    • warning: %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2 discards qualifiers
    • -
    • warning: %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2 discards qualifiers in nested pointer types
    • -
    • warning: %select{reinterpret_cast|C-style cast}0 from %1 to %2 changes address space of nested pointers
    • -
    • warning: incompatible function pointer types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • -
    • warning: incompatible pointer types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: default initialization of an object of const type %0%select{| without a user-provided default constructor}1 is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-incompatible-pointer-types-discards-qualifiers - clang-diagnostic-incompatible-pointer-types-discards-qualifiers + clang-diagnostic-microsoft-cpp-macro + clang-diagnostic-microsoft-cpp-macro Diagnostic text:

      -
    • warning: %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2 discards qualifiers
    • -
    • warning: %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2 discards qualifiers in nested pointer types
    • -
    • warning: %select{reinterpret_cast|C-style cast}0 from %1 to %2 changes address space of nested pointers
    • +
    • warning: C++ operator %0 (aka %1) used as a macro name

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-incomplete-framework-module-declaration - clang-diagnostic-incomplete-framework-module-declaration + clang-diagnostic-microsoft-default-arg-redefinition + clang-diagnostic-microsoft-default-arg-redefinition Diagnostic text:

      -
    • warning: skipping '%0' because module declaration of '%1' lacks the 'framework' qualifier
    • +
    • warning: redefinition of default argument

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-incomplete-module - clang-diagnostic-incomplete-module + clang-diagnostic-microsoft-drectve-section + clang-diagnostic-microsoft-drectve-section Diagnostic text:

      -
    • warning: include of non-modular header inside framework module '%0': '%1'
    • -
    • warning: include of non-modular header inside module '%0': '%1'
    • -
    • warning: missing submodule '%0'
    • -
    • warning: umbrella directory '%0' not found
    • -
    • warning: umbrella header for module '%0' does not include header '%1'
    • +
    • warning: #pragma %0(".drectve") has undefined behavior, use #pragma comment(linker, ...) instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-incomplete-umbrella - clang-diagnostic-incomplete-umbrella + clang-diagnostic-microsoft-end-of-file + clang-diagnostic-microsoft-end-of-file Diagnostic text:

      -
    • warning: missing submodule '%0'
    • -
    • warning: umbrella directory '%0' not found
    • -
    • warning: umbrella header for module '%0' does not include header '%1'
    • +
    • warning: treating Ctrl-Z as end-of-file is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-increment-bool - clang-diagnostic-increment-bool + clang-diagnostic-microsoft-enum-forward-reference + clang-diagnostic-microsoft-enum-forward-reference Diagnostic text:

      -
    • warning: ISO C++17 does not allow incrementing expression of type bool
    • -
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • +
    • warning: forward references to 'enum' types are a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-IndependentClass-attribute - clang-diagnostic-IndependentClass-attribute + clang-diagnostic-microsoft-enum-value + clang-diagnostic-microsoft-enum-value Diagnostic text:

      -
    • warning: 'objc_independent_class' attribute may be put on Objective-C object pointer type only; attribute is ignored
    • -
    • warning: 'objc_independent_class' attribute may be put on a typedef only; attribute is ignored
    • +
    • warning: enumerator value is not representable in the underlying type %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-infinite-recursion - clang-diagnostic-infinite-recursion + clang-diagnostic-microsoft-exception-spec + clang-diagnostic-microsoft-exception-spec Diagnostic text:

      -
    • warning: all paths through this function will call itself
    • +
    • warning: %select{|pointer to |reference to }0incomplete type %1 is not allowed in exception specification
    • +
    • warning: exception specification in declaration does not match previous declaration
    • +
    • warning: exception specification in explicit instantiation does not match instantiated one
    • +
    • warning: exception specification of '...' is a Microsoft extension
    • +
    • warning: exception specification of overriding function is more lax than base version

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-initializer-overrides - clang-diagnostic-initializer-overrides + clang-diagnostic-microsoft-explicit-constructor-call + clang-diagnostic-microsoft-explicit-constructor-call Diagnostic text:

      -
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • -
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • +
    • warning: explicit constructor calls are a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-inline-namespace-reopened-noninline - clang-diagnostic-inline-namespace-reopened-noninline + clang-diagnostic-microsoft-extra-qualification + clang-diagnostic-microsoft-extra-qualification Diagnostic text:

      -
    • warning: inline namespace reopened as a non-inline namespace
    • +
    • warning: extra qualification on member %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-int-conversion - clang-diagnostic-int-conversion + clang-diagnostic-microsoft-fixed-enum + clang-diagnostic-microsoft-fixed-enum Diagnostic text:

      -
    • warning: incompatible integer to pointer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • -
    • warning: incompatible pointer to integer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: enumeration types with a fixed underlying type are a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-int-in-bool-context - clang-diagnostic-int-in-bool-context + clang-diagnostic-microsoft-flexible-array + clang-diagnostic-microsoft-flexible-array Diagnostic text:

      -
    • warning: converting the enum constant to a boolean
    • -
    • warning: converting the result of '<<' to a boolean; did you mean '(%0) != 0'?
    • +
    • warning: flexible array member %0 in a union is a Microsoft extension
    • +
    • warning: flexible array member %0 in otherwise empty %select{struct|interface|union|class|enum}1 is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-int-to-pointer-cast - clang-diagnostic-int-to-pointer-cast + clang-diagnostic-microsoft-goto + clang-diagnostic-microsoft-goto Diagnostic text:

      -
    • warning: cast to %1 from smaller integer type %0
    • -
    • warning: cast to %1 from smaller integer type %0
    • +
    • warning: jump from this goto statement to its label is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-int-to-void-pointer-cast - clang-diagnostic-int-to-void-pointer-cast + clang-diagnostic-microsoft-inaccessible-base + clang-diagnostic-microsoft-inaccessible-base Diagnostic text:

      -
    • warning: cast to %1 from smaller integer type %0
    • +
    • warning: accessing inaccessible direct base %0 of %1 is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-invalid-command-line-argument - clang-diagnostic-invalid-command-line-argument + clang-diagnostic-microsoft-include + clang-diagnostic-microsoft-include Diagnostic text:

      -
    • warning: ignoring extension '%0' because the '%1' architecture does not support it
    • -
    • warning: missing plugin argument for plugin %0 in %1
    • -
    • warning: missing plugin name in %0
    • -
    • warning: no MCU device specified, but '-mhwmult' is set to 'auto', assuming no hardware multiply; use '-mmcu' to specify an MSP430 device, or '-mhwmult' to set the hardware multiply type explicitly
    • -
    • warning: optimization flag '%0' is not supported
    • -
    • warning: optimization flag '%0' is not supported for target '%1'
    • -
    • warning: optimization level '%0' is not supported; using '%1%2' instead
    • -
    • warning: the given MCU does not support hardware multiply, but '-mhwmult' is set to %0
    • -
    • warning: the given MCU supports %0 hardware multiply, but '-mhwmult' is set to %1
    • -
    • warning: the object size sanitizer has no effect at -O0, but is explicitly enabled: %0
    • +
    • warning: #include resolved using non-portable Microsoft search rules as: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-invalid-ios-deployment-target - clang-diagnostic-invalid-ios-deployment-target + clang-diagnostic-inconsistent-dllimport + clang-diagnostic-inconsistent-dllimport Diagnostic text:

      -
    • warning: invalid iOS deployment version '%0', iOS 10 is the maximum deployment target for 32-bit targets
    • +
    • warning: %q0 redeclared without %1 attribute: previous %1 ignored
    • +
    • warning: %q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-invalid-noreturn - clang-diagnostic-invalid-noreturn + clang-diagnostic-microsoft-init-from-predefined + clang-diagnostic-microsoft-init-from-predefined Diagnostic text:

      -
    • warning: function %0 declared 'noreturn' should not return
    • -
    • warning: function declared 'noreturn' should not return
    • +
    • warning: initializing an array from a '%0' predefined identifier is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-invalid-offsetof - clang-diagnostic-invalid-offsetof + clang-diagnostic-microsoft-mutable-reference + clang-diagnostic-microsoft-mutable-reference Diagnostic text:

      -
    • warning: offset of on non-POD type %0
    • -
    • warning: offset of on non-standard-layout type %0
    • +
    • warning: 'mutable' on a reference type is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-invalid-or-nonexistent-directory - clang-diagnostic-invalid-or-nonexistent-directory + clang-diagnostic-microsoft-pure-definition + clang-diagnostic-microsoft-pure-definition Diagnostic text:

      -
    • warning: environment variable SCE_ORBIS_SDK_DIR is set, but points to invalid or nonexistent directory '%0'
    • -
    • warning: unable to find %0 directory, expected to be in '%1'
    • +
    • warning: function definition with pure-specifier is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-invalid-pp-token - clang-diagnostic-invalid-pp-token + clang-diagnostic-microsoft-redeclare-static + clang-diagnostic-microsoft-redeclare-static Diagnostic text:

      -
    • warning: empty character constant
    • -
    • warning: missing terminating %select{'|'"'}0 character
    • +
    • warning: redeclaring non-static %0 as static is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-invalid-source-encoding - clang-diagnostic-invalid-source-encoding + clang-diagnostic-microsoft-sealed + clang-diagnostic-microsoft-sealed Diagnostic text:

      -
    • warning: illegal character encoding in character literal
    • -
    • warning: illegal character encoding in string literal
    • +
    • warning: 'sealed' keyword is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-knr-promoted-parameter - clang-diagnostic-knr-promoted-parameter + clang-diagnostic-microsoft-static-assert + clang-diagnostic-microsoft-static-assert Diagnostic text:

      -
    • warning: %diff{promoted type $ of K&R function parameter is not compatible with the parameter type $|promoted type of K&R function parameter is not compatible with parameter type}0,1 declared in a previous prototype
    • +
    • warning: use of 'static_assert' without inclusion of <assert.h> is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-keyword-macro - clang-diagnostic-keyword-macro + clang-diagnostic-microsoft-string-literal-from-predefined + clang-diagnostic-microsoft-string-literal-from-predefined Diagnostic text:

      -
    • warning: keyword is hidden by macro definition
    • +
    • warning: expansion of predefined identifier '%0' to a string literal is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-keyword-compat - clang-diagnostic-keyword-compat + clang-diagnostic-microsoft-template + clang-diagnostic-microsoft-template Diagnostic text:

      -
    • warning: keyword '%0' will be made available as an identifier %select{here|for the remainder of the translation unit}1
    • +
    • warning: %select{class template|class template partial|variable template|variable template partial|function template|member function|static data member|member class|member enumeration}0 specialization of %1 not in %select{a namespace enclosing %2|class %2 or an enclosing namespace}3 is a Microsoft extension
    • +
    • warning: 'static' can only be specified inside the class definition
    • +
    • warning: declaration of %0 shadows template parameter
    • +
    • warning: duplicate explicit instantiation of %0 ignored as a Microsoft extension
    • +
    • warning: non-type template argument containing a dereference operation is a Microsoft extension
    • +
    • warning: template argument for template type parameter must be a type; omitted 'typename' is a Microsoft extension
    • +
    • warning: unqualified base initializer of class templates is a Microsoft extension
    • +
    • warning: use of member %0 before its declaration is a Microsoft extension
    • +
    • warning: use of member %0 found via unqualified lookup into dependent bases of class templates is a Microsoft extension
    • +
    • warning: use of undeclared identifier %0; unqualified lookup into dependent bases of class template %1 is a Microsoft extension
    • +
    • warning: using the undeclared type %0 as a default template argument is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-large-by-value-copy - clang-diagnostic-large-by-value-copy + clang-diagnostic-microsoft-template-shadow + clang-diagnostic-microsoft-template-shadow Diagnostic text:

      -
    • warning: %0 is a large (%1 bytes) pass-by-value argument; pass it by reference instead ?
    • -
    • warning: return value of %0 is a large (%1 bytes) pass-by-value object; pass it by reference instead ?
    • +
    • warning: declaration of %0 shadows template parameter

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-linker-warnings - clang-diagnostic-linker-warnings + clang-diagnostic-microsoft-union-member-reference + clang-diagnostic-microsoft-union-member-reference Diagnostic text:

      -
    • warning: linking module '%0': %1
    • +
    • warning: union member %0 has reference type %1, which is a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-literal-conversion - clang-diagnostic-literal-conversion + clang-diagnostic-microsoft-unqualified-friend + clang-diagnostic-microsoft-unqualified-friend Diagnostic text:

      -
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • -
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • +
    • warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-literal-range - clang-diagnostic-literal-range + clang-diagnostic-microsoft-using-decl + clang-diagnostic-microsoft-using-decl Diagnostic text:

      -
    • warning: magnitude of floating-point constant too large for type %0; maximum is %1
    • -
    • warning: magnitude of floating-point constant too small for type %0; minimum is %1
    • +
    • warning: using declaration referring to inaccessible member '%0' (which refers to accessible member '%1') is a Microsoft compatibility extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-local-type-template-args - clang-diagnostic-local-type-template-args + clang-diagnostic-microsoft-void-pseudo-dtor + clang-diagnostic-microsoft-void-pseudo-dtor Diagnostic text:

      -
    • warning: local type %0 as template argument is incompatible with C++98
    • -
    • warning: template argument uses local type %0
    • +
    • warning: pseudo-destructors on type void are a Microsoft extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-logical-not-parentheses - clang-diagnostic-logical-not-parentheses + clang-diagnostic-misexpect + clang-diagnostic-misexpect Diagnostic text:

      -
    • warning: logical not is only applied to the left hand side of this %select{comparison|bitwise operator}0
    • +
    • warning: Potential performance regression from use of __builtin_expect(): Annotation was correct on %0 of profiled executions.

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-logical-op-parentheses - clang-diagnostic-logical-op-parentheses + clang-diagnostic-misleading-indentation + clang-diagnostic-misleading-indentation Diagnostic text:

      -
    • warning: '&&' within '||'
    • +
    • warning: misleading indentation; statement is not part of the previous '%select{if|else|for|while}0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-long-long - clang-diagnostic-long-long + clang-diagnostic-mismatched-parameter-types + clang-diagnostic-mismatched-parameter-types Diagnostic text:

      -
    • warning: 'long long' is a C++11 extension
    • -
    • warning: 'long long' is an extension when C99 mode is not enabled
    • +
    • warning: conflicting parameter types in implementation of %0%diff{: $ vs $|}1,2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-loop-analysis - clang-diagnostic-loop-analysis + clang-diagnostic-mismatched-return-types + clang-diagnostic-mismatched-return-types Diagnostic text:

      -
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • -
    • warning: loop variable %0 binds to a temporary value produced by a range of type %1
    • -
    • warning: loop variable %0 creates a copy from type %1
    • -
    • warning: variable %0 is %select{decremented|incremented}1 both in the loop header and in the loop body
    • -
    • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body
    • +
    • warning: conflicting return type in implementation of %0%diff{: $ vs $|}1,2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-macro-redefined - clang-diagnostic-macro-redefined + clang-diagnostic-mismatched-tags + clang-diagnostic-mismatched-tags Diagnostic text:

      -
    • warning: %0 macro redefined
    • +
    • warning: %2 defined as %select{a struct|an interface|a class}0%select{| template}1 here but previously declared as %select{a struct|an interface|a class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • +
    • warning: %select{struct|interface|class}0%select{| template}1 %2 was previously declared as a %select{struct|interface|class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-main - clang-diagnostic-main + clang-diagnostic-missing-braces + clang-diagnostic-missing-braces Diagnostic text:

      -
    • warning: 'main' is not allowed to be declared _Noreturn
    • -
    • warning: 'main' is not allowed to be declared variadic
    • -
    • warning: 'main' should not be declared static
    • -
    • warning: ISO C++ does not allow 'main' to be used by a program
    • -
    • warning: bool literal returned from 'main'
    • -
    • warning: only one parameter on 'main' declaration
    • -
    • warning: variable named 'main' with external linkage has undefined behavior
    • +
    • warning: suggest braces around initialization of subobject

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-main-return-type - clang-diagnostic-main-return-type + clang-diagnostic-missing-declarations + clang-diagnostic-missing-declarations Diagnostic text:

      -
    • warning: return type of 'main' is not 'int'
    • +
    • warning: '%0' ignored on this declaration
    • +
    • warning: '%0' is not permitted on a declaration of a type
    • +
    • warning: declaration does not declare anything
    • +
    • warning: typedef requires a name

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-malformed-warning-check - clang-diagnostic-malformed-warning-check + clang-diagnostic-missing-field-initializers + clang-diagnostic-missing-field-initializers Diagnostic text:

      -
    • warning: __has_warning expected option name (e.g. "-Wundef")
    • +
    • warning: missing field %0 initializer

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-max-tokens - clang-diagnostic-max-tokens + clang-diagnostic-missing-method-return-type + clang-diagnostic-missing-method-return-type Diagnostic text:

      -
    • warning: the number of preprocessor source tokens (%0) exceeds this token limit (%1)
    • -
    • warning: the total number of preprocessor source tokens (%0) exceeds the token limit (%1)
    • +
    • warning: method has no return type specified; defaults to 'id'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-max-unsigned-zero - clang-diagnostic-max-unsigned-zero + clang-diagnostic-missing-noescape + clang-diagnostic-missing-noescape Diagnostic text:

      -
    • warning: taking the max of %select{a value and unsigned zero|unsigned zero and a value}0 is always equal to the other value
    • +
    • warning: parameter of overriding method should be annotated with __attribute__((noescape))

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-memset-transposed-args - clang-diagnostic-memset-transposed-args + clang-diagnostic-missing-noreturn + clang-diagnostic-missing-noreturn Diagnostic text:

      -
    • warning: %select{'size' argument to memset is '0'|setting buffer to a 'sizeof' expression}0; did you mean to transpose the last two arguments?
    • +
    • warning: %select{function|method}0 %1 could be declared with attribute 'noreturn'
    • +
    • warning: block could be declared with attribute 'noreturn'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-method-access - clang-diagnostic-objc-method-access + clang-diagnostic-misspelled-assumption + clang-diagnostic-misspelled-assumption Diagnostic text:

      -
    • warning: class method %objcclass0 not found (return type defaults to 'id')
    • -
    • warning: class method %objcclass0 not found (return type defaults to 'id'); did you mean %objcclass2?
    • -
    • warning: instance method %0 found instead of class method %1
    • -
    • warning: instance method %0 is being used on 'Class' which is not in the root class
    • -
    • warning: instance method %objcinstance0 not found (return type defaults to 'id')
    • -
    • warning: instance method %objcinstance0 not found (return type defaults to 'id'); did you mean %objcinstance2?
    • +
    • warning: unknown assumption string '%0' may be misspelled; attribute is potentially ignored, did you mean '%1'?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-duplicate-method-match - clang-diagnostic-duplicate-method-match + clang-diagnostic-module-build + clang-diagnostic-module-build Diagnostic text:

      -
    • warning: multiple declarations of method %0 found and ignored
    • +
    • remark: building module '%0' as '%1'
    • +
    • remark: could not acquire lock file for module '%0': %1
    • +
    • remark: finished building module '%0'
    • +
    • remark: timed out waiting to acquire lock file for module '%0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-method-signatures - clang-diagnostic-method-signatures + clang-diagnostic-module-conflict + clang-diagnostic-module-conflict Diagnostic text:

      -
    • warning: conflicting parameter types in implementation of %0: %1 vs %2
    • -
    • warning: conflicting return type in implementation of %0: %1 vs %2
    • +
    • warning: module '%0' conflicts with already-imported module '%1': %2
    • +
    • warning: module file '%0' was validated as a system module and is now being imported as a non-system module; any difference in diagnostic options will be ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft - clang-diagnostic-microsoft + clang-diagnostic-module-file-extension + clang-diagnostic-module-file-extension Diagnostic text:

      -
    • warning: #include resolved using non-portable Microsoft search rules as: %0
    • -
    • warning: #pragma %0(".drectve") has undefined behavior, use #pragma comment(linker, ...) instead
    • -
    • warning: %q0 redeclared without %1 attribute: previous %1 ignored
    • -
    • warning: %q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added
    • -
    • warning: %select{class template|class template partial|variable template|variable template partial|function template|member function|static data member|member class|member enumeration}0 specialization of %1 not in %select{a namespace enclosing %2|class %2 or an enclosing namespace}3 is a Microsoft extension
    • -
    • warning: %select{|pointer to |reference to }0incomplete type %1 is not allowed in exception specification
    • -
    • warning: 'abstract' keyword is a Microsoft extension
    • -
    • warning: 'mutable' on a reference type is a Microsoft extension
    • -
    • warning: 'sealed' keyword is a Microsoft extension
    • -
    • warning: 'static' can only be specified inside the class definition
    • -
    • warning: C++ operator %0 (aka %1) used as a macro name
    • -
    • warning: anonymous %select{structs|unions}0 are a Microsoft extension
    • -
    • warning: charizing operator #@ is a Microsoft extension
    • -
    • warning: declaration of %0 shadows template parameter
    • -
    • warning: default initialization of an object of const type %0%select{| without a user-provided default constructor}1 is a Microsoft extension
    • -
    • warning: duplicate explicit instantiation of %0 ignored as a Microsoft extension
    • -
    • warning: enumeration types with a fixed underlying type are a Microsoft extension
    • -
    • warning: enumerator value is not representable in the underlying type %0
    • -
    • warning: exception specification in declaration does not match previous declaration
    • -
    • warning: exception specification in explicit instantiation does not match instantiated one
    • -
    • warning: exception specification of '...' is a Microsoft extension
    • -
    • warning: exception specification of overriding function is more lax than base version
    • -
    • warning: explicit constructor calls are a Microsoft extension
    • -
    • warning: extra qualification on member %0
    • -
    • warning: flexible array member %0 in a union is a Microsoft extension
    • -
    • warning: flexible array member %0 in otherwise empty %select{struct|interface|union|class|enum}1 is a Microsoft extension
    • -
    • warning: forward references to 'enum' types are a Microsoft extension
    • -
    • warning: function definition with pure-specifier is a Microsoft extension
    • -
    • warning: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension
    • -
    • warning: jump from this goto statement to its label is a Microsoft extension
    • -
    • warning: non-type template argument containing a dereference operation is a Microsoft extension
    • -
    • warning: pasting two '/' tokens into a '//' comment is a Microsoft extension
    • -
    • warning: pseudo-destructors on type void are a Microsoft extension
    • -
    • warning: redeclaring non-static %0 as static is a Microsoft extension
    • -
    • warning: redefinition of default argument
    • -
    • warning: static_cast between pointer-to-function and pointer-to-object is a Microsoft extension
    • -
    • warning: template argument for template type parameter must be a type; omitted 'typename' is a Microsoft extension
    • -
    • warning: treating Ctrl-Z as end-of-file is a Microsoft extension
    • -
    • warning: types declared in an anonymous %select{struct|union}0 are a Microsoft extension
    • -
    • warning: union member %0 has reference type %1, which is a Microsoft extension
    • -
    • warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier
    • -
    • warning: use of 'static_assert' without inclusion of <assert.h> is a Microsoft extension
    • -
    • warning: use of member %0 before its declaration is a Microsoft extension
    • -
    • warning: use of member %0 found via unqualified lookup into dependent bases of class templates is a Microsoft extension
    • -
    • warning: use of undeclared identifier %0; unqualified lookup into dependent bases of class template %1 is a Microsoft extension
    • -
    • warning: using declaration referring to inaccessible member '%0' (which refers to accessible member '%1') is a Microsoft compatibility extension
    • -
    • warning: using the undeclared type %0 as a default template argument is a Microsoft extension
    • +
    • warning: duplicate module file extension block name '%0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-abstract - clang-diagnostic-microsoft-abstract + clang-diagnostic-module-import + clang-diagnostic-module-import Diagnostic text:

      -
    • warning: 'abstract' keyword is a Microsoft extension
    • +
    • remark: importing module '%0'%select{| into '%3'}2 from '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-anon-tag - clang-diagnostic-microsoft-anon-tag + clang-diagnostic-module-include-translation + clang-diagnostic-module-include-translation Diagnostic text:

      -
    • warning: anonymous %select{structs|unions}0 are a Microsoft extension
    • -
    • warning: types declared in an anonymous %select{struct|union}0 are a Microsoft extension
    • +
    • remark: treating #%select{include|import|include_next|__include_macros}0 as an import of module '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-cast - clang-diagnostic-microsoft-cast + clang-diagnostic-module-lock + clang-diagnostic-module-lock Diagnostic text:

      -
    • warning: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension
    • -
    • warning: static_cast between pointer-to-function and pointer-to-object is a Microsoft extension
    • +
    • remark: locking '%0' to build module '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-charize - clang-diagnostic-microsoft-charize + clang-diagnostic-most + clang-diagnostic-most Diagnostic text:

      -
    • warning: charizing operator #@ is a Microsoft extension
    • +
    • warning: #pragma execution_character_set expected '%0'
    • +
    • warning: #pragma execution_character_set expected 'push' or 'pop'
    • +
    • warning: #pragma execution_character_set invalid value '%0', only 'UTF-8' is supported
    • +
    • warning: #pragma warning expected '%0'
    • +
    • warning: #pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4
    • +
    • warning: #pragma warning expected a warning number
    • +
    • warning: #pragma warning(push, level) requires a level between 0 and 4
    • +
    • warning: %0
    • +
    • warning: %0 has C-linkage specified, but returns incomplete type %1 which could be incompatible with C
    • +
    • warning: %0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C
    • +
    • warning: %2 defined as %select{a struct|an interface|a class}0%select{| template}1 here but previously declared as %select{a struct|an interface|a class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • +
    • warning: %q0 hides overloaded virtual %select{function|functions}1
    • +
    • warning: %select{aligning a value|the result of checking whether a value is aligned}0 to 1 byte is %select{a no-op|always true}0
    • +
    • warning: %select{delete|destructor}0 called on %1 that is abstract but has non-virtual destructor
    • +
    • warning: %select{delete|destructor}0 called on non-final %1 that has virtual functions but non-virtual destructor
    • +
    • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
    • +
    • warning: %select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior
    • +
    • warning: %select{field|base class}0 %1 will be initialized after %select{field|base}2 %3
    • +
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • +
    • warning: %select{self-|array }0comparison always evaluates to %select{a constant|true|false|'std::strong_ordering::equal'}1
    • +
    • warning: %select{struct|interface|class}0%select{| template}1 %2 was previously declared as a %select{struct|interface|class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • +
    • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
    • +
    • warning: %select{void function|void method|constructor|destructor}1 %0 should not return a value
    • +
    • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++
    • +
    • warning: %sub{subst_format_overflow}0,1,2
    • +
    • warning: %sub{subst_format_overflow}0,1,2
    • +
    • warning: %sub{subst_format_truncation}0,1,2
    • +
    • warning: %sub{subst_format_truncation}0,1,2
    • +
    • warning: '%%n' specifier not supported on this platform
    • +
    • warning: '%0' is not a valid object format flag
    • +
    • warning: '%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument
    • +
    • warning: '&&' of a value and its negation always evaluates to false
    • +
    • warning: '/*' within block comment
    • +
    • warning: 'static' function %0 declared in header file should be declared 'static inline'
    • +
    • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • +
    • warning: '||' of a value and its negation always evaluates to true
    • +
    • warning: // comments are not allowed in this language
    • +
    • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0
    • +
    • warning: adding %0 to a string does not append to the string
    • +
    • warning: all paths through this function will call itself
    • +
    • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
    • +
    • warning: argument %0 of type %1 with mismatched bound
    • +
    • warning: array section %select{lower bound|length}0 is of type 'char'
    • +
    • warning: array subscript is of type 'char'
    • +
    • warning: assigning %select{field|instance variable}0 to itself
    • +
    • warning: base class %0 is uninitialized when used here to access %q1
    • +
    • warning: bitwise comparison always evaluates to %select{false|true}0
    • +
    • warning: bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 did you mean logical negation?
    • +
    • warning: bitwise or with non-zero value always evaluates to true
    • +
    • warning: block pointer variable %0 is %select{uninitialized|null}1 when captured by block
    • +
    • warning: call to undeclared function %0; ISO C99 and later do not support implicit function declarations
    • +
    • warning: call to undeclared library function '%0' with type %1; ISO C99 and later do not support implicit function declarations
    • +
    • warning: calling '%0' with a nonzero argument is unsafe
    • +
    • warning: cannot mix positional and non-positional arguments in format string
    • +
    • warning: cast of type %0 to %1 is deprecated; use sel_getName instead
    • +
    • warning: comparison of %select{address of|function|array}0 '%1' %select{not |}2equal to a null pointer is always %select{true|false}2
    • +
    • warning: comparison of nonnull %select{function call|parameter}0 '%1' %select{not |}2equal to a null pointer is '%select{true|false}2' on first encounter
    • +
    • warning: container access result unused - container access should not be used for side effects
    • +
    • warning: convenience initializer missing a 'self' call to another initializer
    • +
    • warning: convenience initializer should not invoke an initializer on 'super'
    • +
    • warning: converting the enum constant to a boolean
    • +
    • warning: converting the result of '<<' to a boolean always evaluates to %select{false|true}0
    • +
    • warning: converting the result of '<<' to a boolean; did you mean '(%0) != 0'?
    • +
    • warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true'
    • +
    • warning: data argument not used by format string
    • +
    • warning: data argument position '%0' exceeds the number of data arguments (%1)
    • +
    • warning: designated initializer invoked a non-designated initializer
    • +
    • warning: designated initializer missing a 'super' call to a designated initializer of the super class
    • +
    • warning: designated initializer should only invoke a designated initializer on 'super'
    • +
    • warning: double-quoted include "%0" cannot be aliased to angle-bracketed include <%1>
    • +
    • warning: escaped newline between */ characters at block comment end
    • +
    • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
    • +
    • warning: expected end of directive in pragma
    • +
    • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1
    • +
    • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1
    • +
    • warning: explicitly moving variable of type %0 to itself%select{|; did you mean to move to member %2?}1
    • +
    • warning: explicitly moving variable of type %0 to itself%select{|; did you mean to move to member %2?}1
    • +
    • warning: expression result unused
    • +
    • warning: expression result unused; should this cast be to 'void'?
    • +
    • warning: expression with side effects has no effect in an unevaluated context
    • +
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
    • +
    • warning: field %0 can overwrite instance variable %1 with variable sized type %2 in superclass %3
    • +
    • warning: field %0 is uninitialized when used here
    • +
    • warning: field %0 with variable sized type %1 is not visible to subclasses and can conflict with their instance variables
    • +
    • warning: field %select{width|precision}0 should have type %1, but argument has type %2
    • +
    • warning: flag '%0' is ignored when flag '%1' is present
    • +
    • warning: flag '%0' results in undefined behavior with '%1' conversion specifier
    • +
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1
    • +
    • warning: format string contains '\0' within the string body
    • +
    • warning: format string is empty
    • +
    • warning: format string is not a string literal (potentially insecure)
    • +
    • warning: format string is not null-terminated
    • +
    • warning: format string missing
    • +
    • warning: format string should not be a wide string
    • +
    • warning: ignored trigraph would end block comment
    • +
    • warning: ignoring return value of function declared with %0 attribute
    • +
    • warning: ignoring return value of function declared with %0 attribute
    • +
    • warning: ignoring return value of function declared with %0 attribute: %1
    • +
    • warning: ignoring temporary created by a constructor declared with %0 attribute
    • +
    • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
    • +
    • warning: implicit declaration of function %0
    • +
    • warning: implicitly declaring library function '%0' with type %1
    • +
    • warning: incomplete format specifier
    • +
    • warning: initializer order does not match the declaration order
    • +
    • warning: invalid conversion specifier '%0'
    • +
    • warning: invalid position specified for %select{field width|field precision}0
    • +
    • warning: ivar %0 which backs the property is not referenced in this property's accessor
    • +
    • warning: lambda capture %0 is not %select{used|required to be captured for this use}1
    • +
    • warning: left operand of comma operator has no effect
    • +
    • warning: length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier
    • +
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • +
    • warning: loop variable %0 creates a copy from type %1
    • +
    • warning: method override for the designated initializer of the superclass %objcinstance0 not found
    • +
    • warning: method possibly missing a [super %0] call
    • +
    • warning: missing object format flag
    • +
    • warning: more '%%' conversions than data arguments
    • +
    • warning: moving a local object in a return statement prevents copy elision
    • +
    • warning: moving a temporary object prevents copy elision
    • +
    • warning: multi-character character constant
    • +
    • warning: multi-line // comment
    • +
    • warning: no closing ']' for '%%[' in scanf format string
    • +
    • warning: non-void %select{function|method}1 %0 should return a value
    • +
    • warning: non-void %select{function|method}1 %0 should return a value
    • +
    • warning: non-void coroutine does not return a value
    • +
    • warning: non-void coroutine does not return a value in all control paths
    • +
    • warning: non-void function does not return a value
    • +
    • warning: non-void function does not return a value in all control paths
    • +
    • warning: non-void lambda does not return a value
    • +
    • warning: non-void lambda does not return a value in all control paths
    • +
    • warning: null passed to a callee that requires a non-null argument
    • +
    • warning: null returned from %select{function|method}0 that requires a non-null return value
    • +
    • warning: object format flags cannot be used with '%0' conversion specifier
    • +
    • warning: overlapping comparisons always evaluate to %select{false|true}0
    • +
    • warning: parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not support implicit int
    • +
    • warning: position arguments in format strings start counting at 1 (not 0)
    • +
    • warning: pragma STDC FENV_ROUND is not supported
    • +
    • warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'
    • +
    • warning: pragma diagnostic expected option name (e.g. "-Wundef")
    • +
    • warning: pragma diagnostic pop could not pop, no matching push
    • +
    • warning: pragma include_alias expected '%0'
    • +
    • warning: pragma include_alias expected include filename
    • +
    • warning: private field %0 is not used
    • +
    • warning: redundant move in return statement
    • +
    • warning: reference %0 is not yet bound to a value when used here
    • +
    • warning: reference %0 is not yet bound to a value when used within its own initialization
    • +
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • +
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • +
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • +
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: sizeof on array function parameter will return size of %0 instead of %1
    • +
    • warning: sizeof on pointer operation will return size of %0 instead of %1
    • +
    • warning: static variable %0 is suspiciously used within its own initialization
    • +
    • warning: suggest braces around initialization of subobject
    • +
    • warning: trigraph converted to '%0' character
    • +
    • warning: trigraph ends block comment
    • +
    • warning: trigraph ignored
    • +
    • warning: type specifier missing, defaults to 'int'
    • +
    • warning: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int
    • +
    • warning: unexpected token in pragma diagnostic
    • +
    • warning: unknown pragma ignored
    • +
    • warning: unknown pragma in STDC namespace
    • +
    • warning: unused %select{typedef|type alias}0 %1
    • +
    • warning: unused function %0
    • +
    • warning: unused label %0
    • +
    • warning: unused variable %0
    • +
    • warning: unused variable %0
    • +
    • warning: use of __private_extern__ on a declaration may not produce external symbol private to the linkage unit and is deprecated
    • +
    • warning: use of bitwise '%0' with boolean operands
    • +
    • warning: use of unknown builtin %0
    • +
    • warning: using '%%P' format specifier without precision
    • +
    • warning: using '%0' format specifier annotation outside of os_log()/os_trace()
    • +
    • warning: using '%0' format specifier, but argument has boolean value
    • +
    • warning: variable %0 is %select{decremented|incremented}1 both in the loop header and in the loop body
    • +
    • warning: variable %0 is %select{used|captured}1 uninitialized whenever %select{'%3' condition is %select{true|false}4|'%3' loop %select{is entered|exits because its condition is false}4|'%3' loop %select{condition is true|exits because its condition is false}4|switch %3 is taken|its declaration is reached|%3 is called}2
    • +
    • warning: variable %0 is uninitialized when %select{used here|captured by block}1
    • +
    • warning: variable %0 is uninitialized when passed as a const reference argument here
    • +
    • warning: variable %0 is uninitialized when used within its own initialization
    • +
    • warning: variable %0 set but not used
    • +
    • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body
    • +
    • warning: zero field width in scanf format string is unused

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-microsoft-comment-paste - clang-diagnostic-microsoft-comment-paste + clang-diagnostic-move + clang-diagnostic-move Diagnostic text:

      -
    • warning: pasting two '/' tokens into a '//' comment is a Microsoft extension
    • +
    • warning: explicitly moving variable of type %0 to itself%select{|; did you mean to move to member %2?}1
    • +
    • warning: moving a local object in a return statement prevents copy elision
    • +
    • warning: moving a temporary object prevents copy elision
    • +
    • warning: redundant move in return statement

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-const-init - clang-diagnostic-microsoft-const-init + clang-diagnostic-multichar + clang-diagnostic-multichar Diagnostic text:

      -
    • warning: default initialization of an object of const type %0%select{| without a user-provided default constructor}1 is a Microsoft extension
    • +
    • warning: multi-character character constant

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-cpp-macro - clang-diagnostic-microsoft-cpp-macro + clang-diagnostic-multi-gpu + clang-diagnostic-multi-gpu Diagnostic text:

      -
    • warning: C++ operator %0 (aka %1) used as a macro name
    • +
    • warning: multiple %0 architectures are detected: %1; only the first one is used for '%2'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-default-arg-redefinition - clang-diagnostic-microsoft-default-arg-redefinition + clang-diagnostic-nsconsumed-mismatch + clang-diagnostic-nsconsumed-mismatch Diagnostic text:

      -
    • warning: redefinition of default argument
    • +
    • warning: overriding method has mismatched ns_consumed attribute on its parameter

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-drectve-section - clang-diagnostic-microsoft-drectve-section + clang-diagnostic-nsreturns-mismatch + clang-diagnostic-nsreturns-mismatch Diagnostic text:

      -
    • warning: #pragma %0(".drectve") has undefined behavior, use #pragma comment(linker, ...) instead
    • +
    • warning: overriding method has mismatched ns_returns_%select{not_retained|retained}0 attributes

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-end-of-file - clang-diagnostic-microsoft-end-of-file + clang-diagnostic-NSObject-attribute + clang-diagnostic-NSObject-attribute Diagnostic text:

      -
    • warning: treating Ctrl-Z as end-of-file is a Microsoft extension
    • +
    • warning: 'NSObject' attribute may be put on a typedef only; attribute is ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-enum-forward-reference - clang-diagnostic-microsoft-enum-forward-reference + clang-diagnostic-newline-eof + clang-diagnostic-newline-eof Diagnostic text:

      -
    • warning: forward references to 'enum' types are a Microsoft extension
    • +
    • warning: no newline at end of file
    • +
    • warning: no newline at end of file

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-enum-value - clang-diagnostic-microsoft-enum-value + clang-diagnostic-noderef + clang-diagnostic-noderef Diagnostic text:

      -
    • warning: enumerator value is not representable in the underlying type %0
    • +
    • warning: casting to dereferenceable pointer removes 'noderef' attribute
    • +
    • warning: dereferencing %0; was declared with a 'noderef' type
    • +
    • warning: dereferencing expression marked as 'noderef'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-exception-spec - clang-diagnostic-microsoft-exception-spec + clang-diagnostic-noexcept-type + clang-diagnostic-noexcept-type Diagnostic text:

      -
    • warning: %select{|pointer to |reference to }0incomplete type %1 is not allowed in exception specification
    • -
    • warning: exception specification in declaration does not match previous declaration
    • -
    • warning: exception specification in explicit instantiation does not match instantiated one
    • -
    • warning: exception specification of '...' is a Microsoft extension
    • -
    • warning: exception specification of overriding function is more lax than base version
    • +
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-explicit-constructor-call - clang-diagnostic-microsoft-explicit-constructor-call + clang-diagnostic-non-gcc + clang-diagnostic-non-gcc Diagnostic text:

      -
    • warning: explicit constructor calls are a Microsoft extension
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3
    • +
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • +
    • warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    • warning: address of%select{| function| array}0 '%1' will always evaluate to 'true'
    • +
    • warning: assigning value of signed enum type %1 to unsigned bit-field %0; negative enumerators of enum %1 will be converted to positive values
    • +
    • warning: bit-field %0 is not wide enough to store all enumerators of %1
    • +
    • warning: comparison of integers of different signs: %0 and %1
    • +
    • warning: expression which evaluates to zero treated as a null pointer constant of type %0
    • +
    • warning: floating-point comparison is always %select{true|false}0; constant cannot be represented exactly in type %1
    • +
    • warning: higher order bits are zeroes after implicit conversion
    • +
    • warning: implicit boolean conversion of Objective-C object literal always evaluates to true
    • +
    • warning: implicit conversion changes signedness: %0 to %1
    • +
    • warning: implicit conversion discards imaginary component: %0 to %1
    • +
    • warning: implicit conversion from %0 to %1 changes non-zero value from %2 to %3
    • +
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • +
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • +
    • warning: implicit conversion from %0 to %1 may lose precision
    • +
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • +
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • +
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: implicit conversion from enumeration type %0 to different enumeration type %1
    • +
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • +
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • +
    • warning: implicit conversion loses floating-point precision: %0 to %1
    • +
    • warning: implicit conversion loses integer precision: %0 to %1
    • +
    • warning: implicit conversion loses integer precision: %0 to %1
    • +
    • warning: implicit conversion of %select{NULL|nullptr}0 constant to %1
    • +
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • +
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • +
    • warning: implicit conversion turns floating-point number into integer: %0 to %1
    • +
    • warning: implicit conversion turns string literal into bool: %0 to %1
    • +
    • warning: implicit conversion turns vector to scalar: %0 to %1
    • +
    • warning: implicit conversion when assigning computation result loses floating-point precision: %0 to %1
    • +
    • warning: implicit truncation from %2 to a one-bit wide bit-field changes value from %0 to %1
    • +
    • warning: implicit truncation from %2 to bit-field changes value from %0 to %1
    • +
    • warning: incompatible integer to pointer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: incompatible pointer to integer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    • warning: initialization of pointer of type %0 to null from a constant boolean expression
    • +
    • warning: magnitude of floating-point constant too large for type %0; maximum is %1
    • +
    • warning: magnitude of floating-point constant too small for type %0; minimum is %1
    • +
    • warning: non-type template argument value '%0' truncated to '%1' for template parameter of type %2
    • +
    • warning: non-type template argument with value '%0' converted to '%1' for unsigned template parameter of type %2
    • +
    • warning: nonnull %select{function call|parameter}0 '%1' will evaluate to 'true' on first encounter
    • +
    • warning: object of type %0 is not compatible with %select{array element type|dictionary key type|dictionary value type}1 %2
    • +
    • warning: operand of ? changes signedness: %0 to %1
    • +
    • warning: passing non-generic address space pointer to %0 may cause dynamic conversion affecting performance
    • +
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    • warning: signed bit-field %0 needs an extra bit to represent the largest positive enumerators of %1
    • +
    • warning: the resulting value is always non-negative after implicit conversion

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-microsoft-extra-qualification - clang-diagnostic-microsoft-extra-qualification + clang-diagnostic-non-literal-null-conversion + clang-diagnostic-non-literal-null-conversion Diagnostic text:

      -
    • warning: extra qualification on member %0
    • +
    • warning: expression which evaluates to zero treated as a null pointer constant of type %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-fixed-enum - clang-diagnostic-microsoft-fixed-enum + clang-diagnostic-non-modular-include-in-framework-module + clang-diagnostic-non-modular-include-in-framework-module Diagnostic text:

      -
    • warning: enumeration types with a fixed underlying type are a Microsoft extension
    • +
    • warning: include of non-modular header inside framework module '%0': '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-flexible-array - clang-diagnostic-microsoft-flexible-array + clang-diagnostic-non-modular-include-in-module + clang-diagnostic-non-modular-include-in-module Diagnostic text:

      -
    • warning: flexible array member %0 in a union is a Microsoft extension
    • -
    • warning: flexible array member %0 in otherwise empty %select{struct|interface|union|class|enum}1 is a Microsoft extension
    • +
    • warning: include of non-modular header inside framework module '%0': '%1'
    • +
    • warning: include of non-modular header inside module '%0': '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-goto - clang-diagnostic-microsoft-goto + clang-diagnostic-nonnull + clang-diagnostic-nonnull Diagnostic text:

      -
    • warning: jump from this goto statement to its label is a Microsoft extension
    • +
    • warning: null passed to a callee that requires a non-null argument
    • +
    • warning: null returned from %select{function|method}0 that requires a non-null return value

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-inaccessible-base - clang-diagnostic-microsoft-inaccessible-base + clang-diagnostic-non-pod-varargs + clang-diagnostic-non-pod-varargs Diagnostic text:

      -
    • warning: accessing inaccessible direct base %0 of %1 is a Microsoft extension
    • +
    • warning: cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic %select{function|block|method|constructor}2; expected type from format string was %3
    • +
    • warning: cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic %select{function|block|method|constructor}2; call will abort at runtime
    • +
    • warning: second argument to 'va_arg' is of ARC ownership-qualified type %0
    • +
    • warning: second argument to 'va_arg' is of non-POD type %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-microsoft-include - clang-diagnostic-microsoft-include + clang-diagnostic-nontrivial-memaccess + clang-diagnostic-nontrivial-memaccess Diagnostic text:

      -
    • warning: #include resolved using non-portable Microsoft search rules as: %0
    • +
    • warning: %select{destination for|source of|first operand of|second operand of}0 this %1 call is a pointer to record %2 that is not trivial to %select{primitive-default-initialize|primitive-copy}3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-inconsistent-dllimport - clang-diagnostic-inconsistent-dllimport + clang-diagnostic-non-virtual-dtor + clang-diagnostic-non-virtual-dtor Diagnostic text:

      -
    • warning: %q0 redeclared without %1 attribute: previous %1 ignored
    • -
    • warning: %q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added
    • +
    • warning: %0 has virtual functions but non-virtual destructor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-mutable-reference - clang-diagnostic-microsoft-mutable-reference + clang-diagnostic-null-arithmetic + clang-diagnostic-null-arithmetic Diagnostic text:

      -
    • warning: 'mutable' on a reference type is a Microsoft extension
    • +
    • warning: comparison between NULL and non-pointer %select{(%1 and NULL)|(NULL and %1)}0
    • +
    • warning: use of NULL in arithmetic operation

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-pure-definition - clang-diagnostic-microsoft-pure-definition + clang-diagnostic-null-character + clang-diagnostic-null-character Diagnostic text:

      -
    • warning: function definition with pure-specifier is a Microsoft extension
    • +
    • warning: null character ignored
    • +
    • warning: null character(s) preserved in %select{char|string}0 literal

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-redeclare-static - clang-diagnostic-microsoft-redeclare-static + clang-diagnostic-null-conversion + clang-diagnostic-null-conversion Diagnostic text:

      -
    • warning: redeclaring non-static %0 as static is a Microsoft extension
    • +
    • warning: implicit conversion of %select{NULL|nullptr}0 constant to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-sealed - clang-diagnostic-microsoft-sealed + clang-diagnostic-null-dereference + clang-diagnostic-null-dereference Diagnostic text:

      -
    • warning: 'sealed' keyword is a Microsoft extension
    • +
    • warning: binding dereferenced null pointer to reference has undefined behavior
    • +
    • warning: indirection of non-volatile null pointer will be deleted, not trap

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-static-assert - clang-diagnostic-microsoft-static-assert + clang-diagnostic-null-pointer-arithmetic + clang-diagnostic-null-pointer-arithmetic Diagnostic text:

      -
    • warning: use of 'static_assert' without inclusion of <assert.h> is a Microsoft extension
    • +
    • warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension
    • +
    • warning: performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-template - clang-diagnostic-microsoft-template + clang-diagnostic-null-pointer-subtraction + clang-diagnostic-null-pointer-subtraction Diagnostic text:

      -
    • warning: %select{class template|class template partial|variable template|variable template partial|function template|member function|static data member|member class|member enumeration}0 specialization of %1 not in %select{a namespace enclosing %2|class %2 or an enclosing namespace}3 is a Microsoft extension
    • -
    • warning: 'static' can only be specified inside the class definition
    • -
    • warning: declaration of %0 shadows template parameter
    • -
    • warning: duplicate explicit instantiation of %0 ignored as a Microsoft extension
    • -
    • warning: non-type template argument containing a dereference operation is a Microsoft extension
    • -
    • warning: template argument for template type parameter must be a type; omitted 'typename' is a Microsoft extension
    • -
    • warning: use of member %0 before its declaration is a Microsoft extension
    • -
    • warning: use of member %0 found via unqualified lookup into dependent bases of class templates is a Microsoft extension
    • -
    • warning: use of undeclared identifier %0; unqualified lookup into dependent bases of class template %1 is a Microsoft extension
    • -
    • warning: using the undeclared type %0 as a default template argument is a Microsoft extension
    • +
    • warning: performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-template-shadow - clang-diagnostic-microsoft-template-shadow + clang-diagnostic-nullability + clang-diagnostic-nullability Diagnostic text:

      -
    • warning: declaration of %0 shadows template parameter
    • +
    • warning: conflicting nullability specifier on parameter types, %0 conflicts with existing specifier %1
    • +
    • warning: conflicting nullability specifier on return types, %0 conflicts with existing specifier %1
    • +
    • warning: duplicate nullability specifier %0
    • +
    • warning: nullability specifier %0 conflicts with existing specifier %1
    • +
    • warning: synthesized setter %0 for null_resettable property %1 does not handle nil

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-union-member-reference - clang-diagnostic-microsoft-union-member-reference + clang-diagnostic-nullability-completeness + clang-diagnostic-nullability-completeness Diagnostic text:

      -
    • warning: union member %0 has reference type %1, which is a Microsoft extension
    • +
    • warning: %select{pointer|block pointer|member pointer}0 is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
    • +
    • warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-unqualified-friend - clang-diagnostic-microsoft-unqualified-friend + clang-diagnostic-nullability-completeness-on-arrays + clang-diagnostic-nullability-completeness-on-arrays Diagnostic text:

      -
    • warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier
    • +
    • warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-microsoft-using-decl - clang-diagnostic-microsoft-using-decl + clang-diagnostic-nullability-declspec + clang-diagnostic-nullability-declspec Diagnostic text:

      -
    • warning: using declaration referring to inaccessible member '%0' (which refers to accessible member '%1') is a Microsoft compatibility extension
    • +
    • warning: nullability specifier %0 cannot be applied to non-pointer type %1; did you mean to apply the specifier to the %select{pointer|block pointer|member pointer|function pointer|member function pointer}2?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-microsoft-void-pseudo-dtor - clang-diagnostic-microsoft-void-pseudo-dtor + clang-diagnostic-nullability-inferred-on-nested-type + clang-diagnostic-nullability-inferred-on-nested-type Diagnostic text:

      -
    • warning: pseudo-destructors on type void are a Microsoft extension
    • +
    • warning: inferring '_Nonnull' for pointer type within %select{array|reference}0 is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-misleading-indentation - clang-diagnostic-misleading-indentation + clang-diagnostic-nullable-to-nonnull-conversion + clang-diagnostic-nullable-to-nonnull-conversion Diagnostic text:

      -
    • warning: misleading indentation; statement is not part of the previous '%select{if|else|for|while}0'
    • +
    • warning: implicit conversion from nullable pointer %0 to non-nullable pointer type %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-mismatched-parameter-types - clang-diagnostic-mismatched-parameter-types + clang-diagnostic-odr + clang-diagnostic-odr Diagnostic text:

      -
    • warning: conflicting parameter types in implementation of %0%diff{: $ vs $|}1,2
    • +
    • warning: %select{class|instance}0 method %1 has a different number of parameters in different translation units (%2 vs. %3)
    • +
    • warning: %select{class|instance}0 method %1 has a parameter with a different types in different translation units (%2 vs. %3)
    • +
    • warning: %select{class|instance}0 method %1 has incompatible result types in different translation units (%2 vs. %3)
    • +
    • warning: %select{class|instance}0 method %1 is variadic in one translation unit and not variadic in another
    • +
    • warning: class %0 has incompatible superclasses
    • +
    • warning: external function %0 declared with incompatible types in different translation units (%1 vs. %2)
    • +
    • warning: external variable %0 declared with incompatible types in different translation units (%1 vs. %2)
    • +
    • warning: external variable %0 defined in multiple translation units
    • +
    • warning: field %0 declared with incompatible types in different translation units (%1 vs. %2)
    • +
    • warning: instance variable %0 declared with incompatible types in different translation units (%1 vs. %2)
    • +
    • warning: non-type template parameter declared with incompatible types in different translation units (%0 vs. %1)
    • +
    • warning: parameter kind mismatch; parameter is %select{not a|a}0 parameter pack
    • +
    • warning: property %0 declared with incompatible types in different translation units (%1 vs. %2)
    • +
    • warning: property %0 is implemented with %select{@synthesize|@dynamic}1 in one translation but %select{@dynamic|@synthesize}1 in another translation unit
    • +
    • warning: property %0 is synthesized to different ivars in different translation units (%1 vs. %2)
    • +
    • warning: template parameter has different kinds in different translation units
    • +
    • warning: template parameter lists have a different number of parameters (%0 vs %1)
    • +
    • warning: type %0 has incompatible definitions in different translation units

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-mismatched-return-types - clang-diagnostic-mismatched-return-types + clang-diagnostic-objc-bool-constant-conversion + clang-diagnostic-objc-bool-constant-conversion Diagnostic text:

      -
    • warning: conflicting return type in implementation of %0%diff{: $ vs $|}1,2
    • +
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-mismatched-tags - clang-diagnostic-mismatched-tags + clang-diagnostic-objc-boxing + clang-diagnostic-objc-boxing Diagnostic text:

      -
    • warning: %2 defined as %select{a struct|an interface|a class}0%select{| template}1 here but previously declared as %select{a struct|an interface|a class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • -
    • warning: %select{struct|interface|class}0%select{| template}1 %2 was previously declared as a %select{struct|interface|class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • +
    • warning: string is ill-formed as UTF-8 and will become a null %0 when boxed

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-missing-braces - clang-diagnostic-missing-braces + clang-diagnostic-bridge-cast + clang-diagnostic-bridge-cast Diagnostic text:

      -
    • warning: suggest braces around initialization of subobject
    • +
    • warning: %0 bridges to %1, not %2
    • +
    • warning: %0 cannot bridge to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-missing-declarations - clang-diagnostic-missing-declarations + clang-diagnostic-cstring-format-directive + clang-diagnostic-cstring-format-directive Diagnostic text:

      -
    • warning: '%0' ignored on this declaration
    • -
    • warning: '%0' is not permitted on a declaration of a type
    • -
    • warning: declaration does not declare anything
    • -
    • warning: typedef requires a name
    • +
    • warning: using %0 directive in %select{NSString|CFString}1 which is being passed as a formatting argument to the formatting %select{method|CFfunction}2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-missing-field-initializers - clang-diagnostic-missing-field-initializers + clang-diagnostic-objc-cocoa-api + clang-diagnostic-objc-cocoa-api Diagnostic text:

      -
    • warning: missing field %0 initializer
    • +
    • warning: using %0 with a literal is redundant

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-missing-method-return-type - clang-diagnostic-missing-method-return-type + clang-diagnostic-objc-designated-initializers + clang-diagnostic-objc-designated-initializers Diagnostic text:

      -
    • warning: method has no return type specified; defaults to 'id'
    • +
    • warning: convenience initializer missing a 'self' call to another initializer
    • +
    • warning: convenience initializer should not invoke an initializer on 'super'
    • +
    • warning: designated initializer invoked a non-designated initializer
    • +
    • warning: designated initializer missing a 'super' call to a designated initializer of the super class
    • +
    • warning: designated initializer should only invoke a designated initializer on 'super'
    • +
    • warning: method override for the designated initializer of the superclass %objcinstance0 not found

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-missing-noescape - clang-diagnostic-missing-noescape + clang-diagnostic-objc-flexible-array + clang-diagnostic-objc-flexible-array Diagnostic text:

      -
    • warning: parameter of overriding method should be annotated with __attribute__((noescape))
    • +
    • warning: field %0 can overwrite instance variable %1 with variable sized type %2 in superclass %3
    • +
    • warning: field %0 with variable sized type %1 is not visible to subclasses and can conflict with their instance variables

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-missing-noreturn - clang-diagnostic-missing-noreturn + clang-diagnostic-invalid-iboutlet + clang-diagnostic-invalid-iboutlet Diagnostic text:

      -
    • warning: %select{function|method}0 %1 could be declared with attribute 'noreturn'
    • -
    • warning: block could be declared with attribute 'noreturn'
    • +
    • warning: %select{instance variable|property}2 with %0 attribute must be an object type (invalid %1)
    • +
    • warning: IBOutletCollection properties should be copy/strong and not assign

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-misspelled-assumption - clang-diagnostic-misspelled-assumption + clang-diagnostic-objc-literal-compare + clang-diagnostic-objc-literal-compare Diagnostic text:

      -
    • warning: unknown assumption string '%0' may be misspelled; attribute is potentially ignored, did you mean '%1'?
    • +
    • warning: direct comparison of %select{an array literal|a dictionary literal|a numeric literal|a boxed expression|}0 has undefined behavior
    • +
    • warning: direct comparison of a string literal has undefined behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-module-build - clang-diagnostic-module-build + clang-diagnostic-objc-literal-conversion + clang-diagnostic-objc-literal-conversion Diagnostic text:

      -
    • remark: building module '%0' as '%1'
    • -
    • remark: could not acquire lock file for module '%0': %1
    • -
    • remark: finished building module '%0'
    • -
    • remark: timed out waiting to acquire lock file for module '%0'
    • +
    • warning: implicit boolean conversion of Objective-C object literal always evaluates to true
    • +
    • warning: object of type %0 is not compatible with %select{array element type|dictionary key type|dictionary value type}1 %2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-module-conflict - clang-diagnostic-module-conflict + clang-diagnostic-objc-missing-super-calls + clang-diagnostic-objc-missing-super-calls Diagnostic text:

      -
    • warning: module '%0' conflicts with already-imported module '%1': %2
    • -
    • warning: module file '%0' was validated as a system module and is now being imported as a non-system module; any difference in diagnostic options will be ignored
    • +
    • warning: method possibly missing a [super %0] call

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-module-file-extension - clang-diagnostic-module-file-extension + clang-diagnostic-objc-multiple-method-names + clang-diagnostic-objc-multiple-method-names Diagnostic text:

      -
    • warning: duplicate module file extension block name '%0'
    • +
    • warning: multiple methods named %0 found

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-module-import - clang-diagnostic-module-import + clang-diagnostic-objc-property-synthesis + clang-diagnostic-objc-property-synthesis Diagnostic text:

      -
    • remark: importing module '%0'%select{| into '%3'}2 from '%1'
    • +
    • warning: auto property synthesis will not synthesize property %0 because it cannot share an ivar with another synthesized property
    • +
    • warning: auto property synthesis will not synthesize property %0 because it is 'readwrite' but it will be synthesized 'readonly' via another property
    • +
    • warning: auto property synthesis will not synthesize property %0; it will be implemented by its superclass, use @dynamic to acknowledge intention

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-module-lock - clang-diagnostic-module-lock + clang-diagnostic-objc-nonunified-exceptions + clang-diagnostic-objc-nonunified-exceptions Diagnostic text:

      -
    • remark: locking '%0' to build module '%1'
    • +
    • warning: cannot catch an exception thrown with @throw in C++ in the non-unified exception model

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-most - clang-diagnostic-most + clang-diagnostic-deprecated-objc-pointer-introspection + clang-diagnostic-deprecated-objc-pointer-introspection Diagnostic text:

      -
    • warning: #pragma execution_character_set expected '%0'
    • -
    • warning: #pragma execution_character_set expected 'push' or 'pop'
    • -
    • warning: #pragma execution_character_set invalid value '%0', only 'UTF-8' is supported
    • -
    • warning: #pragma warning expected '%0'
    • -
    • warning: #pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4
    • -
    • warning: #pragma warning expected a warning number
    • -
    • warning: #pragma warning(push, level) requires a level between 0 and 4
    • -
    • warning: %0
    • -
    • warning: %0 has C-linkage specified, but returns incomplete type %1 which could be incompatible with C
    • -
    • warning: %0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C
    • -
    • warning: %2 defined as %select{a struct|an interface|a class}0%select{| template}1 here but previously declared as %select{a struct|an interface|a class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • -
    • warning: %q0 hides overloaded virtual %select{function|functions}1
    • -
    • warning: %select{aligning a value|the result of checking whether a value is aligned}0 to 1 byte is %select{a no-op|always true}0
    • -
    • warning: %select{delete|destructor}0 called on %1 that is abstract but has non-virtual destructor
    • -
    • warning: %select{delete|destructor}0 called on non-final %1 that has virtual functions but non-virtual destructor
    • -
    • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
    • -
    • warning: %select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior
    • -
    • warning: %select{field|base class}0 %1 will be initialized after %select{field|base}2 %3
    • -
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • -
    • warning: %select{self-|array }0comparison always evaluates to %select{a constant|true|false|'std::strong_ordering::equal'}1
    • -
    • warning: %select{struct|interface|class}0%select{| template}1 %2 was previously declared as a %select{struct|interface|class}3%select{| template}1; this is valid, but may result in linker errors under the Microsoft C++ ABI
    • -
    • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
    • -
    • warning: %select{void function|void method|constructor|destructor}1 %0 should not return a value
    • -
    • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++
    • -
    • warning: '%%n' specifier not supported on this platform
    • -
    • warning: '%0' is not a valid object format flag
    • -
    • warning: '%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument
    • -
    • warning: '/*' within block comment
    • -
    • warning: 'static' function %0 declared in header file should be declared 'static inline'
    • -
    • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • -
    • warning: // comments are not allowed in this language
    • -
    • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0
    • -
    • warning: adding %0 to a string does not append to the string
    • -
    • warning: all paths through this function will call itself
    • -
    • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
    • -
    • warning: array section %select{lower bound|length}0 is of type 'char'
    • -
    • warning: array subscript is of type 'char'
    • -
    • warning: assigning %select{field|instance variable}0 to itself
    • -
    • warning: base class %0 is uninitialized when used here to access %q1
    • -
    • warning: bitwise comparison always evaluates to %select{false|true}0
    • -
    • warning: bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 did you mean logical negation?
    • -
    • warning: bitwise or with non-zero value always evaluates to true
    • -
    • warning: block pointer variable %0 is %select{uninitialized|null}1 when captured by block
    • -
    • warning: calling '%0' with a nonzero argument is unsafe
    • -
    • warning: cannot mix positional and non-positional arguments in format string
    • -
    • warning: cast of type %0 to %1 is deprecated; use sel_getName instead
    • -
    • warning: comparison of %select{address of|function|array}0 '%1' %select{not |}2equal to a null pointer is always %select{true|false}2
    • -
    • warning: comparison of nonnull %select{function call|parameter}0 '%1' %select{not |}2equal to a null pointer is '%select{true|false}2' on first encounter
    • -
    • warning: container access result unused - container access should not be used for side effects
    • -
    • warning: convenience initializer missing a 'self' call to another initializer
    • -
    • warning: convenience initializer should not invoke an initializer on 'super'
    • -
    • warning: converting the enum constant to a boolean
    • -
    • warning: converting the result of '<<' to a boolean always evaluates to %select{false|true}0
    • -
    • warning: converting the result of '<<' to a boolean; did you mean '(%0) != 0'?
    • -
    • warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true'
    • -
    • warning: data argument not used by format string
    • -
    • warning: data argument position '%0' exceeds the number of data arguments (%1)
    • -
    • warning: designated initializer invoked a non-designated initializer
    • -
    • warning: designated initializer missing a 'super' call to a designated initializer of the super class
    • -
    • warning: designated initializer should only invoke a designated initializer on 'super'
    • -
    • warning: double-quoted include "%0" cannot be aliased to angle-bracketed include <%1>
    • -
    • warning: escaped newline between */ characters at block comment end
    • -
    • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
    • -
    • warning: expected end of directive in pragma
    • -
    • warning: explicitly assigning value of variable of type %0 to itself
    • -
    • warning: explicitly assigning value of variable of type %0 to itself
    • -
    • warning: explicitly moving variable of type %0 to itself
    • -
    • warning: explicitly moving variable of type %0 to itself
    • -
    • warning: expression result unused
    • -
    • warning: expression result unused; should this cast be to 'void'?
    • -
    • warning: expression with side effects has no effect in an unevaluated context
    • -
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
    • -
    • warning: field %0 can overwrite instance variable %1 with variable sized type %2 in superclass %3
    • -
    • warning: field %0 is uninitialized when used here
    • -
    • warning: field %0 with variable sized type %1 is not visible to subclasses and can conflict with their instance variables
    • -
    • warning: field %select{width|precision}0 should have type %1, but argument has type %2
    • -
    • warning: flag '%0' is ignored when flag '%1' is present
    • -
    • warning: flag '%0' results in undefined behavior with '%1' conversion specifier
    • -
    • warning: format specifies type %0 but the argument has %select{type|underlying type}2 %1
    • -
    • warning: format string contains '\0' within the string body
    • -
    • warning: format string is empty
    • -
    • warning: format string is not a string literal (potentially insecure)
    • -
    • warning: format string is not null-terminated
    • -
    • warning: format string missing
    • -
    • warning: format string should not be a wide string
    • -
    • warning: ignored trigraph would end block comment
    • -
    • warning: ignoring return value of function declared with %0 attribute
    • -
    • warning: ignoring return value of function declared with %0 attribute
    • -
    • warning: ignoring return value of function declared with %0 attribute: %1
    • -
    • warning: ignoring temporary created by a constructor declared with %0 attribute
    • -
    • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
    • -
    • warning: implicit declaration of function %0
    • -
    • warning: implicit declaration of function %0 is invalid in C99
    • -
    • warning: implicitly declaring library function '%0' with type %1
    • -
    • warning: incomplete format specifier
    • -
    • warning: initializer order does not match the declaration order
    • -
    • warning: invalid conversion specifier '%0'
    • -
    • warning: invalid position specified for %select{field width|field precision}0
    • -
    • warning: ivar %0 which backs the property is not referenced in this property's accessor
    • -
    • warning: lambda capture %0 is not %select{used|required to be captured for this use}1
    • -
    • warning: left operand of comma operator has no effect
    • -
    • warning: length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier
    • -
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • -
    • warning: loop variable %0 creates a copy from type %1
    • -
    • warning: method override for the designated initializer of the superclass %objcinstance0 not found
    • -
    • warning: method possibly missing a [super %0] call
    • -
    • warning: missing object format flag
    • -
    • warning: more '%%' conversions than data arguments
    • -
    • warning: moving a local object in a return statement prevents copy elision
    • -
    • warning: moving a temporary object prevents copy elision
    • -
    • warning: multi-character character constant
    • -
    • warning: multi-line // comment
    • -
    • warning: no closing ']' for '%%[' in scanf format string
    • -
    • warning: non-void %select{function|method}1 %0 should return a value
    • -
    • warning: non-void %select{function|method}1 %0 should return a value
    • -
    • warning: non-void coroutine does not return a value
    • -
    • warning: non-void coroutine does not return a value in all control paths
    • -
    • warning: non-void function does not return a value
    • -
    • warning: non-void function does not return a value in all control paths
    • -
    • warning: non-void lambda does not return a value
    • -
    • warning: non-void lambda does not return a value in all control paths
    • -
    • warning: null passed to a callee that requires a non-null argument
    • -
    • warning: null returned from %select{function|method}0 that requires a non-null return value
    • -
    • warning: object format flags cannot be used with '%0' conversion specifier
    • -
    • warning: overlapping comparisons always evaluate to %select{false|true}0
    • -
    • warning: position arguments in format strings start counting at 1 (not 0)
    • -
    • warning: pragma STDC FENV_ROUND is not supported
    • -
    • warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'
    • -
    • warning: pragma diagnostic expected option name (e.g. "-Wundef")
    • -
    • warning: pragma diagnostic pop could not pop, no matching push
    • -
    • warning: pragma include_alias expected '%0'
    • -
    • warning: pragma include_alias expected include filename
    • -
    • warning: private field %0 is not used
    • -
    • warning: redundant move in return statement
    • -
    • warning: reference %0 is not yet bound to a value when used here
    • -
    • warning: reference %0 is not yet bound to a value when used within its own initialization
    • -
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • -
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO
    • -
    • warning: sizeof on array function parameter will return size of %0 instead of %1
    • -
    • warning: sizeof on pointer operation will return size of %0 instead of %1
    • -
    • warning: static variable %0 is suspiciously used within its own initialization
    • -
    • warning: suggest braces around initialization of subobject
    • -
    • warning: trigraph converted to '%0' character
    • -
    • warning: trigraph ends block comment
    • -
    • warning: trigraph ignored
    • -
    • warning: type specifier missing, defaults to 'int'
    • -
    • warning: unexpected token in pragma diagnostic
    • -
    • warning: unknown pragma ignored
    • -
    • warning: unknown pragma in STDC namespace
    • -
    • warning: unused %select{typedef|type alias}0 %1
    • -
    • warning: unused function %0
    • -
    • warning: unused label %0
    • -
    • warning: unused variable %0
    • -
    • warning: unused variable %0
    • -
    • warning: use of __private_extern__ on a declaration may not produce external symbol private to the linkage unit and is deprecated
    • -
    • warning: use of bitwise '%0' with boolean operands
    • -
    • warning: use of unknown builtin %0
    • -
    • warning: using '%%P' format specifier without precision
    • -
    • warning: using '%0' format specifier annotation outside of os_log()/os_trace()
    • -
    • warning: using '%0' format specifier, but argument has boolean value
    • -
    • warning: variable %0 is %select{decremented|incremented}1 both in the loop header and in the loop body
    • -
    • warning: variable %0 is %select{used|captured}1 uninitialized whenever %select{'%3' condition is %select{true|false}4|'%3' loop %select{is entered|exits because its condition is false}4|'%3' loop %select{condition is true|exits because its condition is false}4|switch %3 is taken|its declaration is reached|%3 is called}2
    • -
    • warning: variable %0 is uninitialized when %select{used here|captured by block}1
    • -
    • warning: variable %0 is uninitialized when passed as a const reference argument here
    • -
    • warning: variable %0 is uninitialized when used within its own initialization
    • -
    • warning: variable %0 set but not used
    • -
    • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body
    • -
    • warning: zero field width in scanf format string is unused
    • +
    • warning: bitmasking for introspection of Objective-C object pointers is strongly discouraged
    • +
    • warning: bitmasking for introspection of Objective-C object pointers is strongly discouraged

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-move - clang-diagnostic-move + clang-diagnostic-deprecated-objc-pointer-introspection-performSelector + clang-diagnostic-deprecated-objc-pointer-introspection-performSelector Diagnostic text:

      -
    • warning: explicitly moving variable of type %0 to itself
    • -
    • warning: moving a local object in a return statement prevents copy elision
    • -
    • warning: moving a temporary object prevents copy elision
    • -
    • warning: redundant move in return statement
    • +
    • warning: bitmasking for introspection of Objective-C object pointers is strongly discouraged

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-multichar - clang-diagnostic-multichar + clang-diagnostic-potentially-direct-selector + clang-diagnostic-potentially-direct-selector Diagnostic text:

      -
    • warning: multi-character character constant
    • +
    • warning: @selector expression formed with potentially direct selector %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-nsconsumed-mismatch - clang-diagnostic-nsconsumed-mismatch + clang-diagnostic-objc-property-assign-on-object-type + clang-diagnostic-objc-property-assign-on-object-type Diagnostic text:

      -
    • warning: overriding method has mismatched ns_consumed attribute on its parameter
    • +
    • warning: 'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-nsreturns-mismatch - clang-diagnostic-nsreturns-mismatch + clang-diagnostic-objc-property-implementation + clang-diagnostic-objc-property-implementation Diagnostic text:

      -
    • warning: overriding method has mismatched ns_returns_%select{not_retained|retained}0 attributes
    • +
    • warning: class property %0 requires method %1 to be defined - use @dynamic or provide a method implementation in this category
    • +
    • warning: class property %0 requires method %1 to be defined - use @dynamic or provide a method implementation in this class implementation
    • +
    • warning: property %0 requires method %1 to be defined - use @dynamic or provide a method implementation in this category
    • +
    • warning: property %0 requires method %1 to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-NSObject-attribute - clang-diagnostic-NSObject-attribute + clang-diagnostic-objc-property-no-attribute + clang-diagnostic-objc-property-no-attribute Diagnostic text:

      -
    • warning: 'NSObject' attribute may be put on a typedef only; attribute is ignored
    • +
    • warning: default property attribute 'assign' not appropriate for object
    • +
    • warning: no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-newline-eof - clang-diagnostic-newline-eof + clang-diagnostic-objc-protocol-method-implementation + clang-diagnostic-objc-protocol-method-implementation Diagnostic text:

      -
    • warning: no newline at end of file
    • -
    • warning: no newline at end of file
    • +
    • warning: category is implementing a method which will also be implemented by its primary class

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-noderef - clang-diagnostic-noderef + clang-diagnostic-objc-protocol-qualifiers + clang-diagnostic-objc-protocol-qualifiers Diagnostic text:

      -
    • warning: casting to dereferenceable pointer removes 'noderef' attribute
    • -
    • warning: dereferencing %0; was declared with a 'noderef' type
    • -
    • warning: dereferencing expression marked as 'noderef'
    • +
    • warning: parameterized class %0 already conforms to the protocols listed; did you forget a '*'?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-noexcept-type - clang-diagnostic-noexcept-type + clang-diagnostic-objc-readonly-with-setter-property + clang-diagnostic-objc-readonly-with-setter-property Diagnostic text:

      -
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • +
    • warning: setter cannot be specified for a readonly property

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - - clang-diagnostic-non-gcc - clang-diagnostic-non-gcc + + clang-diagnostic-receiver-expr + clang-diagnostic-receiver-expr Diagnostic text:

      -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3
    • -
    • warning: %sub{select_arith_conv_kind}0 %select{floating-point|enumeration}1 type %2 %plural{2:with|4:from|:and}0 %select{enumeration|floating-point}1 type %3 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: %sub{select_arith_conv_kind}0 different enumeration types%diff{ ($ and $)|}1,2 is deprecated
    • -
    • warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
    • -
    • warning: address of%select{| function| array}0 '%1' will always evaluate to 'true'
    • -
    • warning: assigning value of signed enum type %1 to unsigned bit-field %0; negative enumerators of enum %1 will be converted to positive values
    • -
    • warning: bit-field %0 is not wide enough to store all enumerators of %1
    • -
    • warning: comparison of integers of different signs: %0 and %1
    • -
    • warning: expression which evaluates to zero treated as a null pointer constant of type %0
    • -
    • warning: higher order bits are zeroes after implicit conversion
    • -
    • warning: implicit boolean conversion of Objective-C object literal always evaluates to true
    • -
    • warning: implicit conversion changes signedness: %0 to %1
    • -
    • warning: implicit conversion discards imaginary component: %0 to %1
    • -
    • warning: implicit conversion from %0 to %1 changes non-zero value from %2 to %3
    • -
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • -
    • warning: implicit conversion from %0 to %1 changes value from %2 to %3
    • -
    • warning: implicit conversion from %0 to %1 may lose precision
    • -
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • -
    • warning: implicit conversion from %2 to %3 changes value from %0 to %1
    • -
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • -
    • warning: implicit conversion from enumeration type %0 to different enumeration type %1
    • -
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • -
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • -
    • warning: implicit conversion loses floating-point precision: %0 to %1
    • -
    • warning: implicit conversion loses integer precision: %0 to %1
    • -
    • warning: implicit conversion loses integer precision: %0 to %1
    • -
    • warning: implicit conversion of %select{NULL|nullptr}0 constant to %1
    • -
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • -
    • warning: implicit conversion of out of range value from %0 to %1 is undefined
    • -
    • warning: implicit conversion turns floating-point number into integer: %0 to %1
    • -
    • warning: implicit conversion turns string literal into bool: %0 to %1
    • -
    • warning: implicit conversion turns vector to scalar: %0 to %1
    • -
    • warning: implicit conversion when assigning computation result loses floating-point precision: %0 to %1
    • -
    • warning: implicit truncation from %2 to bit-field changes value from %0 to %1
    • -
    • warning: incompatible integer to pointer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • -
    • warning: incompatible pointer to integer conversion %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • -
    • warning: initialization of pointer of type %0 to null from a constant boolean expression
    • -
    • warning: magnitude of floating-point constant too large for type %0; maximum is %1
    • -
    • warning: magnitude of floating-point constant too small for type %0; minimum is %1
    • -
    • warning: non-type template argument value '%0' truncated to '%1' for template parameter of type %2
    • -
    • warning: non-type template argument with value '%0' converted to '%1' for unsigned template parameter of type %2
    • -
    • warning: nonnull %select{function call|parameter}0 '%1' will evaluate to 'true' on first encounter
    • -
    • warning: object of type %0 is not compatible with %select{array element type|dictionary key type|dictionary value type}1 %2
    • -
    • warning: operand of ? changes signedness: %0 to %1
    • -
    • warning: passing non-generic address space pointer to %0 may cause dynamic conversion affecting performance
    • -
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true
    • -
    • warning: signed bit-field %0 needs an extra bit to represent the largest positive enumerators of %1
    • -
    • warning: the resulting value is always non-negative after implicit conversion
    • +
    • warning: receiver type %0 is not 'id' or interface pointer, consider casting it to 'id'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-non-literal-null-conversion - clang-diagnostic-non-literal-null-conversion + clang-diagnostic-objc-redundant-api-use + clang-diagnostic-objc-redundant-api-use Diagnostic text:

      -
    • warning: expression which evaluates to zero treated as a null pointer constant of type %0
    • +
    • warning: using %0 with a literal is redundant

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-non-modular-include-in-framework-module - clang-diagnostic-non-modular-include-in-framework-module + clang-diagnostic-objc-redundant-literal-use + clang-diagnostic-objc-redundant-literal-use Diagnostic text:

      -
    • warning: include of non-modular header inside framework module '%0': '%1'
    • +
    • warning: using %0 with a literal is redundant

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-non-modular-include-in-module - clang-diagnostic-non-modular-include-in-module + clang-diagnostic-objc-noncopy-retain-block-property + clang-diagnostic-objc-noncopy-retain-block-property Diagnostic text:

      -
    • warning: include of non-modular header inside framework module '%0': '%1'
    • -
    • warning: include of non-modular header inside module '%0': '%1'
    • +
    • warning: retain'ed block property does not copy the block - use copy attribute instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-nonnull - clang-diagnostic-nonnull + clang-diagnostic-objc-root-class + clang-diagnostic-objc-root-class Diagnostic text:

      -
    • warning: null passed to a callee that requires a non-null argument
    • -
    • warning: null returned from %select{function|method}0 that requires a non-null return value
    • +
    • warning: class %0 defined without specifying a base class

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-non-pod-varargs - clang-diagnostic-non-pod-varargs + clang-diagnostic-objc-signed-char-bool + clang-diagnostic-objc-signed-char-bool Diagnostic text:

      -
    • warning: cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic %select{function|block|method|constructor}2; expected type from format string was %3
    • -
    • warning: cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic %select{function|block|method|constructor}2; call will abort at runtime
    • -
    • warning: second argument to 'va_arg' is of ARC ownership-qualified type %0
    • -
    • warning: second argument to 'va_arg' is of non-POD type %0
    • +
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • +
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • +
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-nontrivial-memaccess - clang-diagnostic-nontrivial-memaccess + clang-diagnostic-objc-signed-char-bool-implicit-float-conversion + clang-diagnostic-objc-signed-char-bool-implicit-float-conversion Diagnostic text:

      -
    • warning: %select{destination for|source of|first operand of|second operand of}0 this %1 call is a pointer to record %2 that is not trivial to %select{primitive-default-initialize|primitive-copy}3
    • +
    • warning: implicit conversion from floating-point type %0 to 'BOOL'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-non-virtual-dtor - clang-diagnostic-non-virtual-dtor + clang-diagnostic-objc-signed-char-bool-implicit-int-conversion + clang-diagnostic-objc-signed-char-bool-implicit-int-conversion Diagnostic text:

      -
    • warning: %0 has virtual functions but non-virtual destructor
    • +
    • warning: implicit conversion from integral type %0 to 'BOOL'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-null-arithmetic - clang-diagnostic-null-arithmetic + clang-diagnostic-strict-potentially-direct-selector + clang-diagnostic-strict-potentially-direct-selector Diagnostic text:

      -
    • warning: comparison between NULL and non-pointer %select{(%1 and NULL)|(NULL and %1)}0
    • -
    • warning: use of NULL in arithmetic operation
    • +
    • warning: @selector expression formed with potentially direct selector %0
    • +
    • warning: @selector expression formed with potentially direct selector %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-null-character - clang-diagnostic-null-character + clang-diagnostic-objc-string-compare + clang-diagnostic-objc-string-compare Diagnostic text:

      -
    • warning: null character ignored
    • -
    • warning: null character(s) preserved in %select{char|string}0 literal
    • +
    • warning: direct comparison of a string literal has undefined behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-null-conversion - clang-diagnostic-null-conversion + clang-diagnostic-objc-string-concatenation + clang-diagnostic-objc-string-concatenation Diagnostic text:

      -
    • warning: implicit conversion of %select{NULL|nullptr}0 constant to %1
    • +
    • warning: concatenated NSString literal for an NSArray expression - possibly missing a comma

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-null-dereference - clang-diagnostic-null-dereference + clang-diagnostic-old-style-cast + clang-diagnostic-old-style-cast Diagnostic text:

      -
    • warning: binding dereferenced null pointer to reference has undefined behavior
    • -
    • warning: indirection of non-volatile null pointer will be deleted, not trap
    • +
    • warning: use of old-style cast

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-null-pointer-arithmetic - clang-diagnostic-null-pointer-arithmetic + clang-diagnostic-openacc + clang-diagnostic-openacc Diagnostic text:

      -
    • warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension
    • -
    • warning: performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0
    • +
    • warning: OpenACC directives not yet implemented, pragma ignored
    • +
    • warning: unexpected '#pragma acc ...' in program

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-null-pointer-subtraction - clang-diagnostic-null-pointer-subtraction + clang-diagnostic-pedantic-core-features + clang-diagnostic-pedantic-core-features Diagnostic text:

      -
    • warning: performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior
    • +
    • warning: %0 is a core feature in %select{OpenCL C|C++ for OpenCL}1 version %2 but not supported on this target
    • +
    • warning: OpenCL extension %0 is core feature or supported optional core feature - ignoring

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-nullability - clang-diagnostic-nullability + clang-diagnostic-opencl-unsupported-rgba + clang-diagnostic-opencl-unsupported-rgba Diagnostic text:

      -
    • warning: conflicting nullability specifier on parameter types, %0 conflicts with existing specifier %1
    • -
    • warning: conflicting nullability specifier on return types, %0 conflicts with existing specifier %1
    • -
    • warning: duplicate nullability specifier %0
    • -
    • warning: nullability specifier %0 conflicts with existing specifier %1
    • -
    • warning: synthesized setter %0 for null_resettable property %1 does not handle nil
    • +
    • warning: vector component name '%0' is a feature from OpenCL version 3.0 onwards

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-nullability-completeness - clang-diagnostic-nullability-completeness + clang-diagnostic-openmp + clang-diagnostic-openmp Diagnostic text:

      -
    • warning: %select{pointer|block pointer|member pointer}0 is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
    • -
    • warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
    • +
    • warning: %0 clause should not be followed by arguments; tokens will be ignored
    • +
    • warning: '#pragma omp declare variant' cannot be applied for function after first usage; the original function might be used
    • +
    • warning: '#pragma omp declare variant' cannot be applied to the function that was defined already; the original function might be used
    • +
    • warning: '%0' is not a valid context property for the context selector '%1' and the context set '%2'; property ignored
    • +
    • warning: '%0' is not a valid context selector for the context set '%1'; selector ignored
    • +
    • warning: '%0' is not a valid context set in a `declare variant`; set ignored
    • +
    • warning: 'ompx_attribute' clause only allows 'amdgpu_flat_work_group_size', 'amdgpu_waves_per_eu', and 'launch_bounds'; %0 is ignored
    • +
    • warning: OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed
    • +
    • warning: OpenMP offloading target '%0' is similar to target '%1' already specified; will be ignored
    • +
    • warning: OpenMP only allows an ordered construct with the simd clause nested in a simd construct
    • +
    • warning: Type %0 is not trivially copyable and not guaranteed to be mapped correctly
    • +
    • warning: Type %0 is not trivially copyable and not guaranteed to be mapped correctly
    • +
    • warning: aligned clause will be ignored because the requested alignment is not a power of 2
    • +
    • warning: allocate directive specifies %select{default|'%1'}0 allocator while previously used %select{default|'%3'}2
    • +
    • warning: allocator with the 'thread' trait access has unspecified behavior on '%0' directive
    • +
    • warning: declaration is not declared in any declare target region
    • +
    • warning: declaration marked as declare target after first use, it may lead to incorrect results
    • +
    • warning: expected '#pragma omp end declare target' at end of file to match '#pragma omp %0'
    • +
    • warning: expected '%0' after the %1; '%0' assumed
    • +
    • warning: expected identifier or string literal describing a context %select{set|selector|property}0; %select{set|selector|property}0 skipped
    • +
    • warning: initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')
    • +
    • warning: interop type '%0' cannot be specified more than once
    • +
    • warning: isa trait '%0' is not known to the current target; verify the spelling or consider restricting the context selector with the 'arch' selector further
    • +
    • warning: more than one 'device_type' clause is specified
    • +
    • warning: reserved locator 'omp_all_memory' cannot be specified more than once
    • +
    • warning: score expressions in the OpenMP context selector need to be constant; %0 is not and will be ignored
    • +
    • warning: specifying OpenMP directives with [[]] is an OpenMP 5.1 extension
    • +
    • warning: target '%0' does not support exception handling; 'catch' block is ignored
    • +
    • warning: target '%0' does not support exception handling; 'throw' is assumed to be never reached
    • +
    • warning: the context %select{set|selector|property}0 '%1' was used already in the same 'omp declare variant' directive; %select{set|selector|property}0 ignored
    • +
    • warning: the context property '%0' is not valid for the context selector '%1' and the context set '%2'; property ignored
    • +
    • warning: the context selector '%0' in context set '%1' requires a context property defined in parentheses; selector ignored
    • +
    • warning: the context selector '%0' in the context set '%1' cannot have a score ('%2'); score ignored
    • +
    • warning: the context selector '%0' is not valid for the context set '%1'; selector ignored
    • +
    • warning: unexpected '#pragma omp ...' in program
    • +
    • warning: valid %0 clauses start with %1; %select{token|tokens}2 will be ignored
    • +
    • warning: variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'
    • +
    • warning: zero linear step (%0 %select{|and other variables in clause }1should probably be const)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-nullability-completeness-on-arrays - clang-diagnostic-nullability-completeness-on-arrays + clang-diagnostic-openmp-51-extensions + clang-diagnostic-openmp-51-extensions Diagnostic text:

      -
    • warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
    • +
    • warning: specifying OpenMP directives with [[]] is an OpenMP 5.1 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-nullability-declspec - clang-diagnostic-nullability-declspec + clang-diagnostic-openmp-clauses + clang-diagnostic-openmp-clauses Diagnostic text:

      -
    • warning: nullability specifier %0 cannot be applied to non-pointer type %1; did you mean to apply the specifier to the %select{pointer|block pointer|member pointer|function pointer|member function pointer}2?
    • +
    • warning: %0 clause should not be followed by arguments; tokens will be ignored
    • +
    • warning: '%0' is not a valid context property for the context selector '%1' and the context set '%2'; property ignored
    • +
    • warning: '%0' is not a valid context selector for the context set '%1'; selector ignored
    • +
    • warning: '%0' is not a valid context set in a `declare variant`; set ignored
    • +
    • warning: aligned clause will be ignored because the requested alignment is not a power of 2
    • +
    • warning: allocate directive specifies %select{default|'%1'}0 allocator while previously used %select{default|'%3'}2
    • +
    • warning: allocator with the 'thread' trait access has unspecified behavior on '%0' directive
    • +
    • warning: expected '%0' after the %1; '%0' assumed
    • +
    • warning: expected identifier or string literal describing a context %select{set|selector|property}0; %select{set|selector|property}0 skipped
    • +
    • warning: interop type '%0' cannot be specified more than once
    • +
    • warning: more than one 'device_type' clause is specified
    • +
    • warning: reserved locator 'omp_all_memory' cannot be specified more than once
    • +
    • warning: the context %select{set|selector|property}0 '%1' was used already in the same 'omp declare variant' directive; %select{set|selector|property}0 ignored
    • +
    • warning: the context property '%0' is not valid for the context selector '%1' and the context set '%2'; property ignored
    • +
    • warning: the context selector '%0' in context set '%1' requires a context property defined in parentheses; selector ignored
    • +
    • warning: the context selector '%0' in the context set '%1' cannot have a score ('%2'); score ignored
    • +
    • warning: the context selector '%0' is not valid for the context set '%1'; selector ignored
    • +
    • warning: valid %0 clauses start with %1; %select{token|tokens}2 will be ignored
    • +
    • warning: zero linear step (%0 %select{|and other variables in clause }1should probably be const)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-nullability-inferred-on-nested-type - clang-diagnostic-nullability-inferred-on-nested-type + clang-diagnostic-openmp-extensions + clang-diagnostic-openmp-extensions Diagnostic text:

      -
    • warning: inferring '_Nonnull' for pointer type within %select{array|reference}0 is deprecated
    • +
    • warning: 'ompx_attribute' clause only allows 'amdgpu_flat_work_group_size', 'amdgpu_waves_per_eu', and 'launch_bounds'; %0 is ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-nullable-to-nonnull-conversion - clang-diagnostic-nullable-to-nonnull-conversion + clang-diagnostic-openmp-loop-form + clang-diagnostic-openmp-loop-form Diagnostic text:

      -
    • warning: implicit conversion from nullable pointer %0 to non-nullable pointer type %1
    • +
    • warning: OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed
    • +
    • warning: initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-odr - clang-diagnostic-odr + clang-diagnostic-openmp-mapping + clang-diagnostic-openmp-mapping Diagnostic text:

      -
    • warning: %select{class|instance}0 method %1 has a different number of parameters in different translation units (%2 vs. %3)
    • -
    • warning: %select{class|instance}0 method %1 has a parameter with a different types in different translation units (%2 vs. %3)
    • -
    • warning: %select{class|instance}0 method %1 has incompatible result types in different translation units (%2 vs. %3)
    • -
    • warning: %select{class|instance}0 method %1 is variadic in one translation unit and not variadic in another
    • -
    • warning: class %0 has incompatible superclasses
    • -
    • warning: external function %0 declared with incompatible types in different translation units (%1 vs. %2)
    • -
    • warning: external variable %0 declared with incompatible types in different translation units (%1 vs. %2)
    • -
    • warning: external variable %0 defined in multiple translation units
    • -
    • warning: field %0 declared with incompatible types in different translation units (%1 vs. %2)
    • -
    • warning: instance variable %0 declared with incompatible types in different translation units (%1 vs. %2)
    • -
    • warning: non-type template parameter declared with incompatible types in different translation units (%0 vs. %1)
    • -
    • warning: parameter kind mismatch; parameter is %select{not a|a}0 parameter pack
    • -
    • warning: property %0 declared with incompatible types in different translation units (%1 vs. %2)
    • -
    • warning: property %0 is implemented with %select{@synthesize|@dynamic}1 in one translation but %select{@dynamic|@synthesize}1 in another translation unit
    • -
    • warning: property %0 is synthesized to different ivars in different translation units (%1 vs. %2)
    • -
    • warning: template parameter has different kinds in different translation units
    • -
    • warning: template parameter lists have a different number of parameters (%0 vs %1)
    • -
    • warning: type %0 has incompatible definitions in different translation units
    • +
    • warning: Type %0 is not trivially copyable and not guaranteed to be mapped correctly

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-bool-constant-conversion - clang-diagnostic-objc-bool-constant-conversion + clang-diagnostic-pre-openmp-51-compat + clang-diagnostic-pre-openmp-51-compat Diagnostic text:

      -
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: specifying OpenMP directives with [[]] is incompatible with OpenMP standards before OpenMP 5.1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-boxing - clang-diagnostic-objc-boxing + clang-diagnostic-openmp-target + clang-diagnostic-openmp-target Diagnostic text:

      -
    • warning: string is ill-formed as UTF-8 and will become a null %0 when boxed
    • +
    • warning: OpenMP offloading target '%0' is similar to target '%1' already specified; will be ignored
    • +
    • warning: Type %0 is not trivially copyable and not guaranteed to be mapped correctly
    • +
    • warning: declaration is not declared in any declare target region
    • +
    • warning: declaration marked as declare target after first use, it may lead to incorrect results

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-bridge-cast - clang-diagnostic-bridge-cast + clang-diagnostic-openmp-target-exception + clang-diagnostic-openmp-target-exception Diagnostic text:

      -
    • warning: %0 bridges to %1, not %2
    • -
    • warning: %0 cannot bridge to %1
    • +
    • warning: target '%0' does not support exception handling; 'catch' block is ignored
    • +
    • warning: target '%0' does not support exception handling; 'throw' is assumed to be never reached

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-cstring-format-directive - clang-diagnostic-cstring-format-directive + clang-diagnostic-new-returns-null + clang-diagnostic-new-returns-null Diagnostic text:

      -
    • warning: using %0 directive in %select{NSString|CFString}1 which is being passed as a formatting argument to the formatting %select{method|CFfunction}2
    • +
    • warning: %0 should not return a null pointer unless it is declared 'throw()'%select{| or 'noexcept'}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-cocoa-api - clang-diagnostic-objc-cocoa-api + clang-diagnostic-option-ignored + clang-diagnostic-option-ignored Diagnostic text:

      -
    • warning: using %0 with a literal is redundant
    • +
    • warning: %0 requires HVX, use -mhvx/-mhvx= to enable it
    • +
    • warning: %0 requires debug info. Use %1 or debug options that enable debugger's stepping function; option ignored
    • +
    • warning: '%0' does not support '-%1'; flag ignored
    • +
    • warning: '%0' does not support '-moutline'; flag ignored
    • +
    • warning: -fjmc works only for ELF; option ignored
    • +
    • warning: /arm64EC has been overridden by specified target: %0; option ignored
    • +
    • warning: The warning option '-%0' is not supported
    • +
    • warning: ignoring '%0' as it conflicts with that implied by '%1' (%2)
    • +
    • warning: ignoring '%0' option as it cannot be used with %select{implicit usage of|}1 -mabicalls and the N64 ABI
    • +
    • warning: ignoring '%0' option as it is not currently supported for processor '%1'
    • +
    • warning: ignoring '%0' option as it is not currently supported for target '%1'
    • +
    • warning: ignoring '%0' option for offload arch '%1' as it is not currently supported there. Use it with an offload arch containing '%2' instead
    • +
    • warning: ignoring '-mlong-calls' option as it is not currently supported with %select{|the implicit usage of }0-mabicalls
    • +
    • warning: ignoring '-msmall-data-limit=' with -mcmodel=large for -fpic or RV64
    • +
    • warning: option '%0' was ignored by the %1 toolchain, using '-fPIC'
    • +
    • warning: option '-ffine-grained-bitfield-accesses' cannot be enabled together with a sanitizer; flag ignored
    • +
    • warning: the argument '%0' is not supported for option '%1'. Mapping to '%1%2'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-designated-initializers - clang-diagnostic-objc-designated-initializers + clang-diagnostic-ordered-compare-function-pointers + clang-diagnostic-ordered-compare-function-pointers Diagnostic text:

      -
    • warning: convenience initializer missing a 'self' call to another initializer
    • -
    • warning: convenience initializer should not invoke an initializer on 'super'
    • -
    • warning: designated initializer invoked a non-designated initializer
    • -
    • warning: designated initializer missing a 'super' call to a designated initializer of the super class
    • -
    • warning: designated initializer should only invoke a designated initializer on 'super'
    • -
    • warning: method override for the designated initializer of the superclass %objcinstance0 not found
    • +
    • warning: ordered comparison of function pointers (%0 and %1)
    • +
    • warning: ordered comparison of function pointers (%0 and %1)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-flexible-array - clang-diagnostic-objc-flexible-array + clang-diagnostic-out-of-line-declaration + clang-diagnostic-out-of-line-declaration Diagnostic text:

      -
    • warning: field %0 can overwrite instance variable %1 with variable sized type %2 in superclass %3
    • -
    • warning: field %0 with variable sized type %1 is not visible to subclasses and can conflict with their instance variables
    • +
    • warning: out-of-line declaration of a member must be a definition

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-invalid-iboutlet - clang-diagnostic-invalid-iboutlet + clang-diagnostic-over-aligned + clang-diagnostic-over-aligned Diagnostic text:

      -
    • warning: %select{instance variable|property}2 with %0 attribute must be an object type (invalid %1)
    • -
    • warning: IBOutletCollection properties should be copy/strong and not assign
    • +
    • warning: type %0 requires %1 bytes of alignment and the default allocator only guarantees %2 bytes

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-literal-compare - clang-diagnostic-objc-literal-compare + clang-diagnostic-overlength-strings + clang-diagnostic-overlength-strings Diagnostic text:

      -
    • warning: direct comparison of %select{an array literal|a dictionary literal|a numeric literal|a boxed expression|}0 has undefined behavior
    • -
    • warning: direct comparison of a string literal has undefined behavior
    • +
    • warning: string literal of length %0 exceeds maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to support

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-literal-conversion - clang-diagnostic-objc-literal-conversion + clang-diagnostic-overloaded-shift-op-parentheses + clang-diagnostic-overloaded-shift-op-parentheses Diagnostic text:

      -
    • warning: implicit boolean conversion of Objective-C object literal always evaluates to true
    • -
    • warning: object of type %0 is not compatible with %select{array element type|dictionary key type|dictionary value type}1 %2
    • +
    • warning: overloaded operator %select{>>|<<}0 has higher precedence than comparison operator

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-missing-super-calls - clang-diagnostic-objc-missing-super-calls + clang-diagnostic-overloaded-virtual + clang-diagnostic-overloaded-virtual Diagnostic text:

      -
    • warning: method possibly missing a [super %0] call
    • +
    • warning: %q0 hides overloaded virtual %select{function|functions}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-multiple-method-names - clang-diagnostic-objc-multiple-method-names + clang-diagnostic-overriding-method-mismatch + clang-diagnostic-overriding-method-mismatch Diagnostic text:

      -
    • warning: multiple methods named %0 found
    • +
    • warning: conflicting distributed object modifiers on parameter type in declaration of %0
    • +
    • warning: conflicting distributed object modifiers on return type in declaration of %0
    • +
    • warning: conflicting parameter types in declaration of %0%diff{: $ vs $|}1,2
    • +
    • warning: conflicting parameter types in declaration of %0: %1 vs %2
    • +
    • warning: conflicting return type in declaration of %0%diff{: $ vs $|}1,2
    • +
    • warning: conflicting return type in declaration of %0: %1 vs %2
    • +
    • warning: conflicting variadic declaration of method and its implementation

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-property-synthesis - clang-diagnostic-objc-property-synthesis + clang-diagnostic-packed + clang-diagnostic-packed Diagnostic text:

      -
    • warning: auto property synthesis will not synthesize property %0 because it cannot share an ivar with another synthesized property
    • -
    • warning: auto property synthesis will not synthesize property %0 because it is 'readwrite' but it will be synthesized 'readonly' via another property
    • -
    • warning: auto property synthesis will not synthesize property %0; it will be implemented by its superclass, use @dynamic to acknowledge intention
    • +
    • warning: not packing field %0 as it is non-POD for the purposes of layout
    • +
    • warning: packed attribute is unnecessary for %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-nonunified-exceptions - clang-diagnostic-objc-nonunified-exceptions + clang-diagnostic-packed-non-pod + clang-diagnostic-packed-non-pod Diagnostic text:

      -
    • warning: cannot catch an exception thrown with @throw in C++ in the non-unified exception model
    • +
    • warning: not packing field %0 as it is non-POD for the purposes of layout

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-objc-pointer-introspection - clang-diagnostic-deprecated-objc-pointer-introspection + clang-diagnostic-padded + clang-diagnostic-padded Diagnostic text:

      -
    • warning: bitmasking for introspection of Objective-C object pointers is strongly discouraged
    • -
    • warning: bitmasking for introspection of Objective-C object pointers is strongly discouraged
    • +
    • warning: padding %select{struct|interface|class}0 %1 with %2 %select{byte|bit}3%s2 to align %4
    • +
    • warning: padding %select{struct|interface|class}0 %1 with %2 %select{byte|bit}3%s2 to align %4
    • +
    • warning: padding %select{struct|interface|class}0 %1 with %2 %select{byte|bit}3%s2 to align anonymous bit-field
    • +
    • warning: padding %select{struct|interface|class}0 %1 with %2 %select{byte|bit}3%s2 to align anonymous field
    • +
    • warning: padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-objc-pointer-introspection-performSelector - clang-diagnostic-deprecated-objc-pointer-introspection-performSelector + clang-diagnostic-padded-bitfield + clang-diagnostic-padded-bitfield Diagnostic text:

      -
    • warning: bitmasking for introspection of Objective-C object pointers is strongly discouraged
    • +
    • warning: padding %select{struct|interface|class}0 %1 with %2 %select{byte|bit}3%s2 to align %4
    • +
    • warning: padding %select{struct|interface|class}0 %1 with %2 %select{byte|bit}3%s2 to align anonymous bit-field

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-potentially-direct-selector - clang-diagnostic-potentially-direct-selector + clang-diagnostic-parentheses + clang-diagnostic-parentheses Diagnostic text:

      -
    • warning: @selector expression formed with potentially direct selector %0
    • +
    • warning: %0 has lower precedence than %1; %1 will be evaluated first
    • +
    • warning: '%0' within '%1'
    • +
    • warning: '&&' within '||'
    • +
    • warning: add explicit braces to avoid dangling else
    • +
    • warning: equality comparison with extraneous parentheses
    • +
    • warning: logical not is only applied to the left hand side of this %select{comparison|bitwise operator}0
    • +
    • warning: operator '%0' has lower precedence than '%1'; '%1' will be evaluated first
    • +
    • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
    • +
    • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
    • +
    • warning: overloaded operator %select{>>|<<}0 has higher precedence than comparison operator
    • +
    • warning: using the result of an assignment as a condition without parentheses

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-property-assign-on-object-type - clang-diagnostic-objc-property-assign-on-object-type + clang-diagnostic-parentheses-equality + clang-diagnostic-parentheses-equality Diagnostic text:

      -
    • warning: 'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'
    • +
    • warning: equality comparison with extraneous parentheses

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-property-implementation - clang-diagnostic-objc-property-implementation + clang-diagnostic-pedantic-macros + clang-diagnostic-pedantic-macros Diagnostic text:

      -
    • warning: class property %0 requires method %1 to be defined - use @dynamic or provide a method implementation in this category
    • -
    • warning: class property %0 requires method %1 to be defined - use @dynamic or provide a method implementation in this class implementation
    • -
    • warning: property %0 requires method %1 to be defined - use @dynamic or provide a method implementation in this category
    • -
    • warning: property %0 requires method %1 to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
    • +
    • warning: %0 macro redefined
    • +
    • warning: macro %0 has been marked as deprecated%select{|: %2}1
    • +
    • warning: macro %0 has been marked as final and should not be %select{undefined|redefined}1
    • +
    • warning: macro %0 has been marked as unsafe for use in headers%select{|: %2}1
    • +
    • warning: redefining builtin macro
    • +
    • warning: undefining builtin macro

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-property-no-attribute - clang-diagnostic-objc-property-no-attribute + clang-diagnostic-pessimizing-move + clang-diagnostic-pessimizing-move Diagnostic text:

      -
    • warning: default property attribute 'assign' not appropriate for object
    • -
    • warning: no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed
    • +
    • warning: moving a local object in a return statement prevents copy elision
    • +
    • warning: moving a temporary object prevents copy elision

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-protocol-method-implementation - clang-diagnostic-objc-protocol-method-implementation + clang-diagnostic-pointer-arith + clang-diagnostic-pointer-arith Diagnostic text:

      -
    • warning: category is implementing a method which will also be implemented by its primary class
    • +
    • warning: arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension
    • +
    • warning: arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function type%select{|s}2 %1%select{| and %3}2 is a GNU extension
    • +
    • warning: invalid application of '%0' to a function type
    • +
    • warning: invalid application of '%0' to a void type
    • +
    • warning: subscript of a pointer to void is a GNU extension
    • +
    • warning: subtraction of pointers to type %0 of zero size has undefined behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-protocol-qualifiers - clang-diagnostic-objc-protocol-qualifiers + clang-diagnostic-pointer-bool-conversion + clang-diagnostic-pointer-bool-conversion Diagnostic text:

      -
    • warning: parameterized class %0 already conforms to the protocols listed; did you forget a '*'?
    • +
    • warning: address of%select{| function| array}0 '%1' will always evaluate to 'true'
    • +
    • warning: nonnull %select{function call|parameter}0 '%1' will evaluate to 'true' on first encounter

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-readonly-with-setter-property - clang-diagnostic-objc-readonly-with-setter-property + clang-diagnostic-pointer-to-enum-cast + clang-diagnostic-pointer-to-enum-cast Diagnostic text:

      -
    • warning: setter cannot be specified for a readonly property
    • +
    • warning: cast to smaller integer type %1 from %0
    • +
    • warning: cast to smaller integer type %1 from %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-receiver-expr - clang-diagnostic-receiver-expr + clang-diagnostic-pointer-to-int-cast + clang-diagnostic-pointer-to-int-cast Diagnostic text:

      -
    • warning: receiver type %0 is not 'id' or interface pointer, consider casting it to 'id'
    • +
    • warning: cast to smaller integer type %1 from %0
    • +
    • warning: cast to smaller integer type %1 from %0
    • +
    • warning: cast to smaller integer type %1 from %0
    • +
    • warning: cast to smaller integer type %1 from %0
    • +
    • warning: cast to smaller integer type %1 from %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-redundant-api-use - clang-diagnostic-objc-redundant-api-use + clang-diagnostic-potentially-evaluated-expression + clang-diagnostic-potentially-evaluated-expression Diagnostic text:

      -
    • warning: using %0 with a literal is redundant
    • +
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-redundant-literal-use - clang-diagnostic-objc-redundant-literal-use + clang-diagnostic-#pragma-messages + clang-diagnostic-#pragma-messages Diagnostic text:

      -
    • warning: using %0 with a literal is redundant
    • +
    • warning: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-noncopy-retain-block-property - clang-diagnostic-objc-noncopy-retain-block-property + clang-diagnostic-#warnings + clang-diagnostic-#warnings Diagnostic text:

      -
    • warning: retain'ed block property does not copy the block - use copy attribute instead
    • +
    • warning: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-root-class - clang-diagnostic-objc-root-class + clang-diagnostic-pragma-clang-attribute + clang-diagnostic-pragma-clang-attribute Diagnostic text:

      -
    • warning: class %0 defined without specifying a base class
    • +
    • warning: unused attribute %0 in '#pragma clang attribute push' region

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-signed-char-bool - clang-diagnostic-objc-signed-char-bool + clang-diagnostic-pragma-pack + clang-diagnostic-pragma-pack Diagnostic text:

      -
    • warning: implicit conversion from constant value %0 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO
    • -
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • -
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • -
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: non-default #pragma pack value changes the alignment of struct or union members in the included file
    • +
    • warning: the current #pragma pack alignment value is modified in the included file
    • +
    • warning: unterminated '#pragma pack (push, ...)' at end of file

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-signed-char-bool-implicit-float-conversion - clang-diagnostic-objc-signed-char-bool-implicit-float-conversion + clang-diagnostic-pragma-pack-suspicious-include + clang-diagnostic-pragma-pack-suspicious-include Diagnostic text:

      -
    • warning: implicit conversion from floating-point type %0 to 'BOOL'
    • +
    • warning: non-default #pragma pack value changes the alignment of struct or union members in the included file

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-signed-char-bool-implicit-int-conversion - clang-diagnostic-objc-signed-char-bool-implicit-int-conversion + clang-diagnostic-pragmas + clang-diagnostic-pragmas Diagnostic text:

      -
    • warning: implicit conversion from integral type %0 to 'BOOL'
    • +
    • warning: #pragma %0(pop, ...) failed: %1
    • +
    • warning: #pragma execution_character_set expected '%0'
    • +
    • warning: #pragma execution_character_set expected 'push' or 'pop'
    • +
    • warning: #pragma execution_character_set invalid value '%0', only 'UTF-8' is supported
    • +
    • warning: #pragma options align=reset failed: %0
    • +
    • warning: #pragma redefine_extname is applicable to external C declarations only; not applied to %select{function|variable}0 %1
    • +
    • warning: #pragma warning expected '%0'
    • +
    • warning: #pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4
    • +
    • warning: #pragma warning expected a warning number
    • +
    • warning: #pragma warning(push, level) requires a level between 0 and 4
    • +
    • warning: %0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1
    • +
    • warning: %select{value|type}0-dependent expression passed as an argument to debug command
    • +
    • warning: '#pragma %0' is not supported on this target - ignored
    • +
    • warning: '#pragma comment %0' ignored
    • +
    • warning: '#pragma init_seg' is only supported when targeting a Microsoft environment
    • +
    • warning: OpenCL extension %0 unknown or does not require pragma - ignoring
    • +
    • warning: Setting the floating point evaluation method to `source` on a target without SSE is not supported.
    • +
    • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
    • +
    • warning: double-quoted include "%0" cannot be aliased to angle-bracketed include <%1>
    • +
    • warning: expected #pragma pack parameter to be '1', '2', '4', '8', or '16'
    • +
    • warning: expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring
    • +
    • warning: expected '#pragma unused' argument to be a variable name
    • +
    • warning: expected ')' or ',' in '#pragma %0'
    • +
    • warning: expected ',' in '#pragma %0'
    • +
    • warning: expected '=' following '#pragma %select{align|options align}0' - ignored
    • +
    • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
    • +
    • warning: expected 'align' following '#pragma options' - ignored
    • +
    • warning: expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored
    • +
    • warning: expected a stack label or a string literal for the section name in '#pragma %0' - ignored
    • +
    • warning: expected a string literal for the section name in '#pragma %0' - ignored
    • +
    • warning: expected action or ')' in '#pragma %0' - ignored
    • +
    • warning: expected end of directive in pragma
    • +
    • warning: expected identifier in '#pragma %0' - ignored
    • +
    • warning: expected integer between %0 and %1 inclusive in '#pragma %2' - ignored
    • +
    • warning: expected integer or identifier in '#pragma pack' - ignored
    • +
    • warning: expected non-wide string literal in '#pragma %0'
    • +
    • warning: expected push, pop or a string literal for the section name in '#pragma %0' - ignored
    • +
    • warning: expected string literal in '#pragma %0' - ignoring
    • +
    • warning: expected string literal in 'clause %0' - ignoring
    • +
    • warning: extra tokens at end of '#pragma %0' - ignored
    • +
    • warning: incorrect use of #pragma clang force_cuda_host_device begin|end
    • +
    • warning: incorrect use of '#pragma fenv_access (on|off)' - ignored
    • +
    • warning: incorrect use of '#pragma ms_struct on|off' - ignored
    • +
    • warning: invalid alignment option in '#pragma %select{align|options align}0' - ignored
    • +
    • warning: invalid or unsupported rounding mode in '#pragma STDC FENV_ROUND' - ignored
    • +
    • warning: known but unsupported action '%1' for '#pragma %0' - ignored
    • +
    • warning: missing '(' after '#pragma %0' - ignoring
    • +
    • warning: missing ')' after '#pragma %0' - ignoring
    • +
    • warning: missing ':' after %0 - ignoring
    • +
    • warning: missing ':' or ')' after %0 - ignoring
    • +
    • warning: missing argument to '#pragma %0'%select{|; expected %2}1
    • +
    • warning: missing argument to debug command '%0'
    • +
    • warning: missing debug command
    • +
    • warning: non-default #pragma pack value changes the alignment of struct or union members in the included file
    • +
    • warning: only variables can be arguments to '#pragma unused'
    • +
    • warning: pragma STDC FENV_ROUND is not supported
    • +
    • warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'
    • +
    • warning: pragma diagnostic expected option name (e.g. "-Wundef")
    • +
    • warning: pragma diagnostic pop could not pop, no matching push
    • +
    • warning: pragma include_alias expected '%0'
    • +
    • warning: pragma include_alias expected include filename
    • +
    • warning: pragma pop_macro could not pop '%0', no matching push_macro
    • +
    • warning: the current #pragma pack alignment value is modified in the included file
    • +
    • warning: undeclared variable %0 used as an argument for '#pragma unused'
    • +
    • warning: unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2
    • +
    • warning: unexpected argument to debug command
    • +
    • warning: unexpected debug command '%0'
    • +
    • warning: unexpected token in pragma diagnostic
    • +
    • warning: unknown action '%1' for '#pragma %0' - ignored
    • +
    • warning: unknown action for '#pragma %0' - ignored
    • +
    • warning: unknown module '%0'
    • +
    • warning: unknown pragma ignored
    • +
    • warning: unknown pragma in STDC namespace
    • +
    • warning: unsupported OpenCL extension %0 - ignoring
    • +
    • warning: unterminated '#pragma pack (push, ...)' at end of file
    • +
    • warning: unused attribute %0 in '#pragma clang attribute push' region

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-strict-potentially-direct-selector - clang-diagnostic-strict-potentially-direct-selector + clang-diagnostic-private-extern + clang-diagnostic-private-extern Diagnostic text:

      -
    • warning: @selector expression formed with potentially direct selector %0
    • -
    • warning: @selector expression formed with potentially direct selector %0
    • +
    • warning: use of __private_extern__ on a declaration may not produce external symbol private to the linkage unit and is deprecated

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-string-compare - clang-diagnostic-objc-string-compare + clang-diagnostic-private-module + clang-diagnostic-private-module Diagnostic text:

      -
    • warning: direct comparison of a string literal has undefined behavior
    • +
    • warning: expected canonical name for private module '%0'
    • +
    • warning: module '%0' already re-exported as '%1'
    • +
    • warning: no submodule named %0 in module '%1'; using top level '%2'
    • +
    • warning: private submodule '%0' in private module map, expected top-level module

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-objc-string-concatenation - clang-diagnostic-objc-string-concatenation + clang-diagnostic-profile-instr-missing + clang-diagnostic-profile-instr-missing Diagnostic text:

      -
    • warning: concatenated NSString literal for an NSArray expression - possibly missing a comma
    • +
    • warning: profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1 no data

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-old-style-cast - clang-diagnostic-old-style-cast + clang-diagnostic-profile-instr-out-of-date + clang-diagnostic-profile-instr-out-of-date Diagnostic text:

      -
    • warning: use of old-style cast
    • +
    • warning: profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1 mismatched data that will be ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pedantic-core-features - clang-diagnostic-pedantic-core-features + clang-diagnostic-profile-instr-unprofiled + clang-diagnostic-profile-instr-unprofiled Diagnostic text:

      -
    • warning: %0 is a core feature in %select{OpenCL C|C++ for OpenCL}1 version %2 but not supported on this target
    • -
    • warning: OpenCL extension %0 is core feature or supported optional core feature - ignoring
    • +
    • warning: no profile data available for file "%0"

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-opencl-unsupported-rgba - clang-diagnostic-opencl-unsupported-rgba + clang-diagnostic-property-access-dot-syntax + clang-diagnostic-property-access-dot-syntax Diagnostic text:

      -
    • warning: vector component name '%0' is a feature from OpenCL version 3.0 onwards
    • +
    • warning: property %0 not found on object of type %1; did you mean to access property %2?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-openmp - clang-diagnostic-openmp + clang-diagnostic-property-attribute-mismatch + clang-diagnostic-property-attribute-mismatch Diagnostic text:

      -
    • warning: %0 clause should not be followed by arguments; tokens will be ignored
    • -
    • warning: '#pragma omp declare variant' cannot be applied for function after first usage; the original function might be used
    • -
    • warning: '#pragma omp declare variant' cannot be applied to the function that was defined already; the original function might be used
    • -
    • warning: '%0' is not a valid context property for the context selector '%1' and the context set '%2'; property ignored
    • -
    • warning: '%0' is not a valid context selector for the context set '%1'; selector ignored
    • -
    • warning: '%0' is not a valid context set in a `declare variant`; set ignored
    • -
    • warning: OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed
    • -
    • warning: OpenMP offloading target '%0' is similar to target '%1' already specified; will be ignored
    • -
    • warning: OpenMP only allows an ordered construct with the simd clause nested in a simd construct
    • -
    • warning: Type %0 is not trivially copyable and not guaranteed to be mapped correctly
    • -
    • warning: Type %0 is not trivially copyable and not guaranteed to be mapped correctly
    • -
    • warning: aligned clause will be ignored because the requested alignment is not a power of 2
    • -
    • warning: allocate directive specifies %select{default|'%1'}0 allocator while previously used %select{default|'%3'}2
    • -
    • warning: allocator with the 'thread' trait access has unspecified behavior on '%0' directive
    • -
    • warning: declaration is not declared in any declare target region
    • -
    • warning: declaration marked as declare target after first use, it may lead to incorrect results
    • -
    • warning: expected '%0' after the %1; '%0' assumed
    • -
    • warning: expected identifier or string literal describing a context %select{set|selector|property}0; %select{set|selector|property}0 skipped
    • -
    • warning: initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')
    • -
    • warning: interop type '%0' cannot be specified more than once
    • -
    • warning: isa trait '%0' is not known to the current target; verify the spelling or consider restricting the context selector with the 'arch' selector further
    • -
    • warning: more than one 'device_type' clause is specified
    • -
    • warning: score expressions in the OpenMP context selector need to be constant; %0 is not and will be ignored
    • -
    • warning: specifying OpenMP directives with [[]] is an OpenMP 5.1 extension
    • -
    • warning: the context %select{set|selector|property}0 '%1' was used already in the same 'omp declare variant' directive; %select{set|selector|property}0 ignored
    • -
    • warning: the context property '%0' is not valid for the context selector '%1' and the context set '%2'; property ignored
    • -
    • warning: the context selector '%0' in context set '%1' requires a context property defined in parentheses; selector ignored
    • -
    • warning: the context selector '%0' in the context set '%1' cannot have a score ('%2'); score ignored
    • -
    • warning: the context selector '%0' is not valid for the context set '%1'; selector ignored
    • -
    • warning: unexpected '#pragma omp ...' in program
    • -
    • warning: valid %0 clauses start with %1; %select{token|tokens}2 will be ignored
    • -
    • warning: variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'
    • -
    • warning: zero linear step (%0 %select{|and other variables in clause }1should probably be const)
    • +
    • warning: '%1' attribute on property %0 does not match the property inherited from %2
    • +
    • warning: attribute 'readonly' of property %0 restricts attribute 'readwrite' of property inherited from %1
    • +
    • warning: getter name mismatch between property redeclaration (%1) and its original declaration (%0)
    • +
    • warning: property attribute in class extension does not match the primary class

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-openmp-51-extensions - clang-diagnostic-openmp-51-extensions + clang-diagnostic-protocol + clang-diagnostic-protocol Diagnostic text:

      -
    • warning: specifying OpenMP directives with [[]] is an OpenMP 5.1 extension
    • +
    • warning: method %0 in protocol %1 not implemented

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-openmp-clauses - clang-diagnostic-openmp-clauses + clang-diagnostic-call-to-pure-virtual-from-ctor-dtor + clang-diagnostic-call-to-pure-virtual-from-ctor-dtor Diagnostic text:

      -
    • warning: %0 clause should not be followed by arguments; tokens will be ignored
    • -
    • warning: '%0' is not a valid context property for the context selector '%1' and the context set '%2'; property ignored
    • -
    • warning: '%0' is not a valid context selector for the context set '%1'; selector ignored
    • -
    • warning: '%0' is not a valid context set in a `declare variant`; set ignored
    • -
    • warning: aligned clause will be ignored because the requested alignment is not a power of 2
    • -
    • warning: allocate directive specifies %select{default|'%1'}0 allocator while previously used %select{default|'%3'}2
    • -
    • warning: allocator with the 'thread' trait access has unspecified behavior on '%0' directive
    • -
    • warning: expected '%0' after the %1; '%0' assumed
    • -
    • warning: expected identifier or string literal describing a context %select{set|selector|property}0; %select{set|selector|property}0 skipped
    • -
    • warning: interop type '%0' cannot be specified more than once
    • -
    • warning: more than one 'device_type' clause is specified
    • -
    • warning: the context %select{set|selector|property}0 '%1' was used already in the same 'omp declare variant' directive; %select{set|selector|property}0 ignored
    • -
    • warning: the context property '%0' is not valid for the context selector '%1' and the context set '%2'; property ignored
    • -
    • warning: the context selector '%0' in context set '%1' requires a context property defined in parentheses; selector ignored
    • -
    • warning: the context selector '%0' in the context set '%1' cannot have a score ('%2'); score ignored
    • -
    • warning: the context selector '%0' is not valid for the context set '%1'; selector ignored
    • -
    • warning: valid %0 clauses start with %1; %select{token|tokens}2 will be ignored
    • -
    • warning: zero linear step (%0 %select{|and other variables in clause }1should probably be const)
    • +
    • warning: call to pure virtual member function %0 has undefined behavior; overrides of %0 in subclasses are not available in the %select{constructor|destructor}1 of %2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-openmp-loop-form - clang-diagnostic-openmp-loop-form + clang-diagnostic-rtti + clang-diagnostic-rtti Diagnostic text:

      -
    • warning: OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed
    • -
    • warning: initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')
    • +
    • warning: dynamic_cast will not work since RTTI data is disabled by %select{-fno-rtti-data|/GR-}0
    • +
    • warning: typeid will not work since RTTI data is disabled by %select{-fno-rtti-data|/GR-}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-openmp-mapping - clang-diagnostic-openmp-mapping + clang-diagnostic-range-loop-analysis + clang-diagnostic-range-loop-analysis Diagnostic text:

      -
    • warning: Type %0 is not trivially copyable and not guaranteed to be mapped correctly
    • +
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • +
    • warning: loop variable %0 binds to a temporary value produced by a range of type %1
    • +
    • warning: loop variable %0 creates a copy from type %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pre-openmp-51-compat - clang-diagnostic-pre-openmp-51-compat + clang-diagnostic-range-loop-bind-reference + clang-diagnostic-range-loop-bind-reference Diagnostic text:

      -
    • warning: specifying OpenMP directives with [[]] is incompatible with OpenMP standards before OpenMP 5.1
    • +
    • warning: loop variable %0 binds to a temporary value produced by a range of type %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-openmp-target - clang-diagnostic-openmp-target + clang-diagnostic-range-loop-construct + clang-diagnostic-range-loop-construct Diagnostic text:

      -
    • warning: OpenMP offloading target '%0' is similar to target '%1' already specified; will be ignored
    • -
    • warning: Type %0 is not trivially copyable and not guaranteed to be mapped correctly
    • -
    • warning: declaration is not declared in any declare target region
    • -
    • warning: declaration marked as declare target after first use, it may lead to incorrect results
    • +
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • +
    • warning: loop variable %0 creates a copy from type %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-new-returns-null - clang-diagnostic-new-returns-null + clang-diagnostic-read-only-types + clang-diagnostic-read-only-types Diagnostic text:

      -
    • warning: %0 should not return a null pointer unless it is declared 'throw()'%select{| or 'noexcept'}1
    • +
    • warning: object of type %0 cannot be placed in read-only memory

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-option-ignored - clang-diagnostic-option-ignored + clang-diagnostic-redeclared-class-member + clang-diagnostic-redeclared-class-member Diagnostic text:

      -
    • warning: %0 requires HVX, use -mhvx/-mhvx= to enable it
    • -
    • warning: '%0' does not support '-%1'; flag ignored
    • -
    • warning: '%0' does not support '-moutline'; flag ignored
    • -
    • warning: /JMC requires debug info. Use '/Zi', '/Z7' or other debug options; option ignored
    • -
    • warning: ignoring '%0' option as it cannot be used with %select{implicit usage of|}1 -mabicalls and the N64 ABI
    • -
    • warning: ignoring '%0' option as it is not currently supported for offload arch '%1'. Use it with an offload arch containing '%2' instead
    • -
    • warning: ignoring '%0' option as it is not currently supported for target '%1'
    • -
    • warning: ignoring '-mlong-calls' option as it is not currently supported with %select{|the implicit usage of }0-mabicalls
    • -
    • warning: ignoring '-msmall-data-limit=' with -mcmodel=large for -fpic or RV64
    • -
    • warning: option '%0' was ignored by the PS4 toolchain, using '-fPIC'
    • -
    • warning: option '-ffine-grained-bitfield-accesses' cannot be enabled together with a sanitizer; flag ignored
    • +
    • warning: class member cannot be redeclared

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-ordered-compare-function-pointers - clang-diagnostic-ordered-compare-function-pointers + clang-diagnostic-redundant-move + clang-diagnostic-redundant-move Diagnostic text:

      -
    • warning: ordered comparison of function pointers (%0 and %1)
    • -
    • warning: ordered comparison of function pointers (%0 and %1)
    • +
    • warning: redundant move in return statement

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-out-of-line-declaration - clang-diagnostic-out-of-line-declaration + clang-diagnostic-register + clang-diagnostic-register Diagnostic text:

      -
    • warning: out-of-line declaration of a member must be a definition
    • +
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • +
    • warning: ISO C++17 does not allow 'register' storage class specifier

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    CRITICAL
    - clang-diagnostic-over-aligned - clang-diagnostic-over-aligned + clang-diagnostic-reinterpret-base-class + clang-diagnostic-reinterpret-base-class Diagnostic text:

      -
    • warning: type %0 requires %1 bytes of alignment and the default allocator only guarantees %2 bytes
    • +
    • warning: 'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its %select{virtual base|base at non-zero offset}2 %1 behaves differently from 'static_cast'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-overlength-strings - clang-diagnostic-overlength-strings + clang-diagnostic-remark-backend-plugin + clang-diagnostic-remark-backend-plugin Diagnostic text:

      -
    • warning: string literal of length %0 exceeds maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to support
    • +
    • remark: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-overloaded-shift-op-parentheses - clang-diagnostic-overloaded-shift-op-parentheses + clang-diagnostic-reorder + clang-diagnostic-reorder Diagnostic text:

      -
    • warning: overloaded operator %select{>>|<<}0 has higher precedence than comparison operator
    • +
    • warning: %select{field|base class}0 %1 will be initialized after %select{field|base}2 %3
    • +
    • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0
    • +
    • warning: initializer order does not match the declaration order

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-overloaded-virtual - clang-diagnostic-overloaded-virtual + clang-diagnostic-reorder-ctor + clang-diagnostic-reorder-ctor Diagnostic text:

      -
    • warning: %q0 hides overloaded virtual %select{function|functions}1
    • +
    • warning: %select{field|base class}0 %1 will be initialized after %select{field|base}2 %3
    • +
    • warning: initializer order does not match the declaration order

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-overriding-method-mismatch - clang-diagnostic-overriding-method-mismatch + clang-diagnostic-reorder-init-list + clang-diagnostic-reorder-init-list Diagnostic text:

      -
    • warning: conflicting distributed object modifiers on parameter type in declaration of %0
    • -
    • warning: conflicting distributed object modifiers on return type in declaration of %0
    • -
    • warning: conflicting parameter types in declaration of %0%diff{: $ vs $|}1,2
    • -
    • warning: conflicting parameter types in declaration of %0: %1 vs %2
    • -
    • warning: conflicting return type in declaration of %0%diff{: $ vs $|}1,2
    • -
    • warning: conflicting return type in declaration of %0: %1 vs %2
    • -
    • warning: conflicting variadic declaration of method and its implementation
    • +
    • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-packed - clang-diagnostic-packed + clang-diagnostic-reserved-macro-identifier + clang-diagnostic-reserved-macro-identifier Diagnostic text:

      -
    • warning: packed attribute is unnecessary for %0
    • +
    • warning: macro name is a reserved identifier

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-padded - clang-diagnostic-padded + clang-diagnostic-reserved-id-macro + clang-diagnostic-reserved-id-macro Diagnostic text:

      -
    • warning: padding %select{struct|interface|class}0 %1 with %2 %select{byte|bit}3%s2 to align %4
    • -
    • warning: padding %select{struct|interface|class}0 %1 with %2 %select{byte|bit}3%s2 to align anonymous bit-field
    • -
    • warning: padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary
    • +
    • warning: macro name is a reserved identifier

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-parentheses - clang-diagnostic-parentheses + clang-diagnostic-reserved-identifier + clang-diagnostic-reserved-identifier Diagnostic text:

      -
    • warning: %0 has lower precedence than %1; %1 will be evaluated first
    • -
    • warning: '%0' within '%1'
    • -
    • warning: '&&' within '||'
    • -
    • warning: add explicit braces to avoid dangling else
    • -
    • warning: equality comparison with extraneous parentheses
    • -
    • warning: logical not is only applied to the left hand side of this %select{comparison|bitwise operator}0
    • -
    • warning: operator '%0' has lower precedence than '%1'; '%1' will be evaluated first
    • -
    • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
    • -
    • warning: operator '?:' has lower precedence than '%0'; '%0' will be evaluated first
    • -
    • warning: overloaded operator %select{>>|<<}0 has higher precedence than comparison operator
    • -
    • warning: using the result of an assignment as a condition without parentheses
    • +
    • warning: %0 is a reserved name for a module
    • +
    • warning: identifier %0 is reserved because %select{<ERROR>|it starts with '_' at global scope|it starts with '_' and has C language linkage|it starts with '__'|it starts with '_' followed by a capital letter|it contains '__'}1
    • +
    • warning: macro name is a reserved identifier
    • +
    • warning: user-defined literal suffixes %select{<ERROR>|not starting with '_'|containing '__'}0 are reserved%select{; no literal will invoke this operator|}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-parentheses-equality - clang-diagnostic-parentheses-equality + clang-diagnostic-reserved-module-identifier + clang-diagnostic-reserved-module-identifier Diagnostic text:

      -
    • warning: equality comparison with extraneous parentheses
    • +
    • warning: %0 is a reserved name for a module

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pedantic-macros - clang-diagnostic-pedantic-macros + clang-diagnostic-reserved-user-defined-literal + clang-diagnostic-reserved-user-defined-literal + + Diagnostic text:

    +
      +
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    • +
    • warning: invalid suffix on literal; C++11 requires a space between literal and identifier
    • +
    • warning: invalid suffix on literal; C++11 requires a space between literal and identifier
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + CRITICAL +
    + + clang-diagnostic-restrict-expansion + clang-diagnostic-restrict-expansion Diagnostic text:

      -
    • warning: %0 macro redefined
    • -
    • warning: macro %0 has been marked as deprecated%select{|: %2}1
    • -
    • warning: macro %0 has been marked as final and should not be %select{undefined|redefined}1
    • warning: macro %0 has been marked as unsafe for use in headers%select{|: %2}1
    • -
    • warning: redefining builtin macro
    • -
    • warning: undefining builtin macro

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-return-stack-address + clang-diagnostic-return-stack-address + + Diagnostic text:

    +
      +
    • warning: %select{address of|reference to}0 stack memory associated with %select{local variable|parameter}2 %1 returned
    • +
    • warning: returning %select{address of|reference to}0 local temporary object
    • +
    • warning: returning address of label, which is local
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-return-std-move + clang-diagnostic-return-std-move + + Diagnostic text:

    +
      +
    • warning: local variable %0 will be copied despite being %select{returned|thrown}1 by name
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pessimizing-move - clang-diagnostic-pessimizing-move + clang-diagnostic-return-type + clang-diagnostic-return-type Diagnostic text:

      -
    • warning: moving a local object in a return statement prevents copy elision
    • -
    • warning: moving a temporary object prevents copy elision
    • +
    • warning: %0 has C-linkage specified, but returns incomplete type %1 which could be incompatible with C
    • +
    • warning: %0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C
    • +
    • warning: %select{void function|void method|constructor|destructor}1 %0 should not return a value
    • +
    • warning: non-void %select{function|method}1 %0 should return a value
    • +
    • warning: non-void %select{function|method}1 %0 should return a value
    • +
    • warning: non-void coroutine does not return a value
    • +
    • warning: non-void coroutine does not return a value in all control paths
    • +
    • warning: non-void function does not return a value
    • +
    • warning: non-void function does not return a value in all control paths
    • +
    • warning: non-void lambda does not return a value
    • +
    • warning: non-void lambda does not return a value in all control paths

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-pointer-arith - clang-diagnostic-pointer-arith + clang-diagnostic-return-type-c-linkage + clang-diagnostic-return-type-c-linkage Diagnostic text:

      -
    • warning: arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension
    • -
    • warning: arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function type%select{|s}2 %1%select{| and %3}2 is a GNU extension
    • -
    • warning: invalid application of '%0' to a function type
    • -
    • warning: invalid application of '%0' to a void type
    • -
    • warning: subscript of a pointer to void is a GNU extension
    • -
    • warning: subtraction of pointers to type %0 of zero size has undefined behavior
    • +
    • warning: %0 has C-linkage specified, but returns incomplete type %1 which could be incompatible with C
    • +
    • warning: %0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pointer-bool-conversion - clang-diagnostic-pointer-bool-conversion + clang-diagnostic-round-trip-cc1-args + clang-diagnostic-round-trip-cc1-args Diagnostic text:

      -
    • warning: address of%select{| function| array}0 '%1' will always evaluate to 'true'
    • -
    • warning: nonnull %select{function call|parameter}0 '%1' will evaluate to 'true' on first encounter
    • +
    • remark: generated arguments #%0 in round-trip: %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pointer-to-enum-cast - clang-diagnostic-pointer-to-enum-cast + clang-diagnostic-sanitize-address + clang-diagnostic-sanitize-address Diagnostic text:

      -
    • warning: cast to smaller integer type %1 from %0
    • -
    • warning: cast to smaller integer type %1 from %0
    • +
    • remark: -fsanitize-address-field-padding applied to %0
    • +
    • remark: -fsanitize-address-field-padding ignored for %0 because it %select{is not C++|is packed|is a union|is trivially copyable|has trivial destructor|is standard layout|is in a ignorelisted file|is ignorelisted}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pointer-to-int-cast - clang-diagnostic-pointer-to-int-cast + clang-diagnostic-section + clang-diagnostic-section Diagnostic text:

      -
    • warning: cast to smaller integer type %1 from %0
    • -
    • warning: cast to smaller integer type %1 from %0
    • -
    • warning: cast to smaller integer type %1 from %0
    • -
    • warning: cast to smaller integer type %1 from %0
    • -
    • warning: cast to smaller integer type %1 from %0
    • +
    • warning: %select{codeseg|section}0 does not match previous declaration
    • +
    • warning: duplicate code segment specifiers
    • +
    • warning: section attribute is specified on redeclared variable

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-potentially-evaluated-expression - clang-diagnostic-potentially-evaluated-expression + clang-diagnostic-cast-of-sel-type + clang-diagnostic-cast-of-sel-type Diagnostic text:

      -
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
    • +
    • warning: cast of type %0 to %1 is deprecated; use sel_getName instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-#pragma-messages - clang-diagnostic-#pragma-messages + clang-diagnostic-selector + clang-diagnostic-selector Diagnostic text:

      -
    • warning: %0
    • +
    • warning: no method with selector %0 is implemented in this translation unit
    • +
    • warning: several methods with selector %0 of mismatched types are found for the @selector expression

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-#warnings - clang-diagnostic-#warnings + clang-diagnostic-selector-type-mismatch + clang-diagnostic-selector-type-mismatch Diagnostic text:

      -
    • warning: %0
    • +
    • warning: several methods with selector %0 of mismatched types are found for the @selector expression

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pragma-clang-attribute - clang-diagnostic-pragma-clang-attribute + clang-diagnostic-self-assign + clang-diagnostic-self-assign Diagnostic text:

      -
    • warning: unused attribute %0 in '#pragma clang attribute push' region
    • +
    • warning: assigning %select{field|instance variable}0 to itself
    • +
    • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1
    • +
    • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pragma-pack - clang-diagnostic-pragma-pack + clang-diagnostic-self-assign-field + clang-diagnostic-self-assign-field Diagnostic text:

      -
    • warning: non-default #pragma pack value changes the alignment of struct or union members in the included file
    • -
    • warning: the current #pragma pack alignment value is modified in the included file
    • -
    • warning: unterminated '#pragma pack (push, ...)' at end of file
    • +
    • warning: assigning %select{field|instance variable}0 to itself

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pragma-pack-suspicious-include - clang-diagnostic-pragma-pack-suspicious-include + clang-diagnostic-self-assign-overloaded + clang-diagnostic-self-assign-overloaded Diagnostic text:

      -
    • warning: non-default #pragma pack value changes the alignment of struct or union members in the included file
    • +
    • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-pragmas - clang-diagnostic-pragmas + clang-diagnostic-self-move + clang-diagnostic-self-move Diagnostic text:

      -
    • warning: #pragma %0(pop, ...) failed: %1
    • -
    • warning: #pragma execution_character_set expected '%0'
    • -
    • warning: #pragma execution_character_set expected 'push' or 'pop'
    • -
    • warning: #pragma execution_character_set invalid value '%0', only 'UTF-8' is supported
    • -
    • warning: #pragma options align=reset failed: %0
    • -
    • warning: #pragma redefine_extname is applicable to external C declarations only; not applied to %select{function|variable}0 %1
    • -
    • warning: #pragma warning expected '%0'
    • -
    • warning: #pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4
    • -
    • warning: #pragma warning expected a warning number
    • -
    • warning: #pragma warning(push, level) requires a level between 0 and 4
    • -
    • warning: %0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1
    • -
    • warning: '#pragma %0' is not supported on this target - ignored
    • -
    • warning: '#pragma comment %0' ignored
    • -
    • warning: '#pragma init_seg' is only supported when targeting a Microsoft environment
    • -
    • warning: '#pragma optimize' is not supported
    • -
    • warning: Setting the floating point evaluation method to `source` on a target without SSE is not supported.
    • -
    • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
    • -
    • warning: double-quoted include "%0" cannot be aliased to angle-bracketed include <%1>
    • -
    • warning: expected #pragma pack parameter to be '1', '2', '4', '8', or '16'
    • -
    • warning: expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring
    • -
    • warning: expected '#pragma unused' argument to be a variable name
    • -
    • warning: expected ')' or ',' in '#pragma %0'
    • -
    • warning: expected ',' in '#pragma %0'
    • -
    • warning: expected '=' following '#pragma %select{align|options align}0' - ignored
    • -
    • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
    • -
    • warning: expected 'align' following '#pragma options' - ignored
    • -
    • warning: expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored
    • -
    • warning: expected a stack label or a string literal for the section name in '#pragma %0' - ignored
    • -
    • warning: expected a string literal for the section name in '#pragma %0' - ignored
    • -
    • warning: expected action or ')' in '#pragma %0' - ignored
    • -
    • warning: expected end of directive in pragma
    • -
    • warning: expected identifier in '#pragma %0' - ignored
    • -
    • warning: expected integer between %0 and %1 inclusive in '#pragma %2' - ignored
    • -
    • warning: expected integer or identifier in '#pragma pack' - ignored
    • -
    • warning: expected non-wide string literal in '#pragma %0'
    • -
    • warning: expected push, pop or a string literal for the section name in '#pragma %0' - ignored
    • -
    • warning: expected string literal in '#pragma %0' - ignoring
    • -
    • warning: extra tokens at end of '#pragma %0' - ignored
    • -
    • warning: incorrect use of #pragma clang force_cuda_host_device begin|end
    • -
    • warning: incorrect use of '#pragma fenv_access (on|off)' - ignored
    • -
    • warning: incorrect use of '#pragma ms_struct on|off' - ignored
    • -
    • warning: invalid alignment option in '#pragma %select{align|options align}0' - ignored
    • -
    • warning: invalid or unsupported rounding mode in '#pragma STDC FENV_ROUND' - ignored
    • -
    • warning: known but unsupported action '%1' for '#pragma %0' - ignored
    • -
    • warning: missing '(' after '#pragma %0' - ignoring
    • -
    • warning: missing ')' after '#pragma %0' - ignoring
    • -
    • warning: missing ':' after %0 - ignoring
    • -
    • warning: missing ':' or ')' after %0 - ignoring
    • -
    • warning: missing argument to '#pragma %0'%select{|; expected %2}1
    • -
    • warning: missing argument to debug command '%0'
    • -
    • warning: non-default #pragma pack value changes the alignment of struct or union members in the included file
    • -
    • warning: only variables can be arguments to '#pragma unused'
    • -
    • warning: pragma STDC FENV_ROUND is not supported
    • -
    • warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'
    • -
    • warning: pragma diagnostic expected option name (e.g. "-Wundef")
    • -
    • warning: pragma diagnostic pop could not pop, no matching push
    • -
    • warning: pragma include_alias expected '%0'
    • -
    • warning: pragma include_alias expected include filename
    • -
    • warning: pragma pop_macro could not pop '%0', no matching push_macro
    • -
    • warning: the current #pragma pack alignment value is modified in the included file
    • -
    • warning: undeclared variable %0 used as an argument for '#pragma unused'
    • -
    • warning: unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2
    • -
    • warning: unexpected debug command '%0'
    • -
    • warning: unexpected token in pragma diagnostic
    • -
    • warning: unknown OpenCL extension %0 - ignoring
    • -
    • warning: unknown action '%1' for '#pragma %0' - ignored
    • -
    • warning: unknown action for '#pragma %0' - ignored
    • -
    • warning: unknown module '%0'
    • -
    • warning: unknown pragma ignored
    • -
    • warning: unknown pragma in STDC namespace
    • -
    • warning: unsupported OpenCL extension %0 - ignoring
    • -
    • warning: unterminated '#pragma pack (push, ...)' at end of file
    • -
    • warning: unused attribute %0 in '#pragma clang attribute push' region
    • +
    • warning: explicitly moving variable of type %0 to itself%select{|; did you mean to move to member %2?}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-private-extern - clang-diagnostic-private-extern + clang-diagnostic-semicolon-before-method-body + clang-diagnostic-semicolon-before-method-body Diagnostic text:

      -
    • warning: use of __private_extern__ on a declaration may not produce external symbol private to the linkage unit and is deprecated
    • +
    • warning: semicolon before method body is ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-private-module - clang-diagnostic-private-module + clang-diagnostic-sentinel + clang-diagnostic-sentinel Diagnostic text:

      -
    • warning: expected canonical name for private module '%0'
    • -
    • warning: module '%0' already re-exported as '%1'
    • -
    • warning: no submodule named %0 in module '%1'; using top level '%2'
    • -
    • warning: private submodule '%0' in private module map, expected top-level module
    • +
    • warning: missing sentinel in %select{function call|method dispatch|block call}0
    • +
    • warning: not enough variable arguments in %0 declaration to fit a sentinel

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-profile-instr-missing - clang-diagnostic-profile-instr-missing + clang-diagnostic-serialized-diagnostics + clang-diagnostic-serialized-diagnostics Diagnostic text:

      -
    • warning: profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1 no data
    • +
    • warning: Received warning after diagnostic serialization teardown was underway: %0
    • +
    • warning: unable to merge a subprocess's serialized diagnostics
    • +
    • warning: unable to open file %0 for serializing diagnostics (%1)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-profile-instr-out-of-date - clang-diagnostic-profile-instr-out-of-date + clang-diagnostic-shadow + clang-diagnostic-shadow Diagnostic text:

      -
    • warning: profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1 mismatched data that will be ignored
    • +
    • warning: declaration shadows a %select{local variable|variable in %2|static data member of %2|field of %2|typedef in %2|type alias in %2|structured binding}1
    • +
    • warning: local declaration of %0 hides instance variable
    • +
    • warning: modifying constructor parameter %0 that shadows a field of %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-profile-instr-unprofiled - clang-diagnostic-profile-instr-unprofiled + clang-diagnostic-shadow-all + clang-diagnostic-shadow-all Diagnostic text:

      -
    • warning: no profile data available for file "%0"
    • +
    • warning: %select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows member inherited from type %2
    • +
    • warning: constructor parameter %0 shadows the field %1 of %2
    • +
    • warning: declaration shadows a %select{local variable|variable in %2|static data member of %2|field of %2|typedef in %2|type alias in %2|structured binding}1
    • +
    • warning: declaration shadows a %select{local variable|variable in %2|static data member of %2|field of %2|typedef in %2|type alias in %2|structured binding}1
    • +
    • warning: local declaration of %0 hides instance variable
    • +
    • warning: modifying constructor parameter %0 that shadows a field of %1
    • +
    • warning: modifying constructor parameter %0 that shadows a field of %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-property-access-dot-syntax - clang-diagnostic-property-access-dot-syntax + clang-diagnostic-shadow-field + clang-diagnostic-shadow-field Diagnostic text:

      -
    • warning: property %0 not found on object of type %1; did you mean to access property %2?
    • +
    • warning: %select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows member inherited from type %2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-property-attribute-mismatch - clang-diagnostic-property-attribute-mismatch + clang-diagnostic-shadow-field-in-constructor + clang-diagnostic-shadow-field-in-constructor Diagnostic text:

      -
    • warning: '%1' attribute on property %0 does not match the property inherited from %2
    • -
    • warning: attribute 'readonly' of property %0 restricts attribute 'readwrite' of property inherited from %1
    • -
    • warning: getter name mismatch between property redeclaration (%1) and its original declaration (%0)
    • -
    • warning: property attribute in class extension does not match the primary class
    • +
    • warning: constructor parameter %0 shadows the field %1 of %2
    • +
    • warning: modifying constructor parameter %0 that shadows a field of %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-protocol - clang-diagnostic-protocol + clang-diagnostic-shadow-field-in-constructor-modified + clang-diagnostic-shadow-field-in-constructor-modified Diagnostic text:

      -
    • warning: method %0 in protocol %1 not implemented
    • +
    • warning: modifying constructor parameter %0 that shadows a field of %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-call-to-pure-virtual-from-ctor-dtor - clang-diagnostic-call-to-pure-virtual-from-ctor-dtor + clang-diagnostic-shadow-ivar + clang-diagnostic-shadow-ivar Diagnostic text:

      -
    • warning: call to pure virtual member function %0 has undefined behavior; overrides of %0 in subclasses are not available in the %select{constructor|destructor}1 of %2
    • +
    • warning: local declaration of %0 hides instance variable

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-rtti - clang-diagnostic-rtti + clang-diagnostic-shadow-uncaptured-local + clang-diagnostic-shadow-uncaptured-local Diagnostic text:

      -
    • warning: dynamic_cast will not work since RTTI data is disabled by %select{-fno-rtti-data|/GR-}0
    • -
    • warning: typeid will not work since RTTI data is disabled by %select{-fno-rtti-data|/GR-}0
    • +
    • warning: declaration shadows a %select{local variable|variable in %2|static data member of %2|field of %2|typedef in %2|type alias in %2|structured binding}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-range-loop-analysis - clang-diagnostic-range-loop-analysis + clang-diagnostic-shift-op-parentheses + clang-diagnostic-shift-op-parentheses Diagnostic text:

      -
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • -
    • warning: loop variable %0 binds to a temporary value produced by a range of type %1
    • -
    • warning: loop variable %0 creates a copy from type %1
    • +
    • warning: operator '%0' has lower precedence than '%1'; '%1' will be evaluated first

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-range-loop-bind-reference - clang-diagnostic-range-loop-bind-reference + clang-diagnostic-shorten-64-to-32 + clang-diagnostic-shorten-64-to-32 Diagnostic text:

      -
    • warning: loop variable %0 binds to a temporary value produced by a range of type %1
    • +
    • warning: implicit conversion loses integer precision: %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-range-loop-construct - clang-diagnostic-range-loop-construct + clang-diagnostic-sign-compare + clang-diagnostic-sign-compare Diagnostic text:

      -
    • warning: loop variable %0 %diff{of type $ binds to a temporary constructed from type $|binds to a temporary constructed from a different type}1,2
    • -
    • warning: loop variable %0 creates a copy from type %1
    • +
    • warning: comparison of integers of different signs: %0 and %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-redeclared-class-member - clang-diagnostic-redeclared-class-member + clang-diagnostic-sign-conversion + clang-diagnostic-sign-conversion Diagnostic text:

      -
    • warning: class member cannot be redeclared
    • +
    • warning: implicit conversion changes signedness: %0 to %1
    • +
    • warning: operand of ? changes signedness: %0 to %1
    • +
    • warning: the resulting value is always non-negative after implicit conversion

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-redundant-move - clang-diagnostic-redundant-move + clang-diagnostic-signed-enum-bitfield + clang-diagnostic-signed-enum-bitfield Diagnostic text:

      -
    • warning: redundant move in return statement
    • +
    • warning: enums in the Microsoft ABI are signed integers by default; consider giving the enum %0 an unsigned underlying type to make this code portable

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-register - clang-diagnostic-register + clang-diagnostic-single-bit-bitfield-constant-conversion + clang-diagnostic-single-bit-bitfield-constant-conversion Diagnostic text:

      -
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • -
    • warning: ISO C++17 does not allow 'register' storage class specifier
    • +
    • warning: implicit truncation from %2 to a one-bit wide bit-field changes value from %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-reinterpret-base-class - clang-diagnostic-reinterpret-base-class + clang-diagnostic-sizeof-array-argument + clang-diagnostic-sizeof-array-argument Diagnostic text:

      -
    • warning: 'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its %select{virtual base|base at non-zero offset}2 %1 behaves differently from 'static_cast'
    • +
    • warning: sizeof on array function parameter will return size of %0 instead of %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-remark-backend-plugin - clang-diagnostic-remark-backend-plugin + clang-diagnostic-sizeof-array-decay + clang-diagnostic-sizeof-array-decay Diagnostic text:

      -
    • remark: %0
    • +
    • warning: sizeof on pointer operation will return size of %0 instead of %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-reorder - clang-diagnostic-reorder + clang-diagnostic-sizeof-pointer-memaccess + clang-diagnostic-sizeof-pointer-memaccess Diagnostic text:

      -
    • warning: %select{field|base class}0 %1 will be initialized after %select{field|base}2 %3
    • -
    • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0
    • -
    • warning: initializer order does not match the declaration order
    • +
    • warning: '%0' call operates on objects of type %1 while the size is based on a different type %2
    • +
    • warning: argument to 'sizeof' in %0 call is the same pointer type %1 as the %select{destination|source}2; expected %3 or an explicit length

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-reorder-ctor - clang-diagnostic-reorder-ctor + clang-diagnostic-source-uses-openacc + clang-diagnostic-source-uses-openacc Diagnostic text:

      -
    • warning: %select{field|base class}0 %1 will be initialized after %select{field|base}2 %3
    • -
    • warning: initializer order does not match the declaration order
    • +
    • warning: OpenACC directives not yet implemented, pragma ignored
    • +
    • warning: unexpected '#pragma acc ...' in program

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-reorder-init-list - clang-diagnostic-reorder-init-list + clang-diagnostic-source-uses-openmp + clang-diagnostic-source-uses-openmp Diagnostic text:

      -
    • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0
    • +
    • warning: '#pragma omp declare variant' cannot be applied for function after first usage; the original function might be used
    • +
    • warning: '#pragma omp declare variant' cannot be applied to the function that was defined already; the original function might be used
    • +
    • warning: OpenMP only allows an ordered construct with the simd clause nested in a simd construct
    • +
    • warning: expected '#pragma omp end declare target' at end of file to match '#pragma omp %0'
    • +
    • warning: isa trait '%0' is not known to the current target; verify the spelling or consider restricting the context selector with the 'arch' selector further
    • +
    • warning: score expressions in the OpenMP context selector need to be constant; %0 is not and will be ignored
    • +
    • warning: unexpected '#pragma omp ...' in program
    • +
    • warning: variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-reserved-macro-identifier - clang-diagnostic-reserved-macro-identifier + clang-diagnostic-spir-compat + clang-diagnostic-spir-compat Diagnostic text:

      -
    • warning: macro name is a reserved identifier
    • +
    • warning: sampler initializer has invalid %0 bits

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-reserved-id-macro - clang-diagnostic-reserved-id-macro + clang-diagnostic-static-float-init + clang-diagnostic-static-float-init Diagnostic text:

      -
    • warning: macro name is a reserved identifier
    • +
    • warning: in-class initializer for static data member of type %0 is a GNU extension
    • +
    • warning: in-class initializer for static data member of type %0 requires 'constexpr' specifier

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-reserved-identifier - clang-diagnostic-reserved-identifier + clang-diagnostic-static-in-inline + clang-diagnostic-static-in-inline Diagnostic text:

      -
    • warning: identifier %0 is reserved because %select{<ERROR>|it starts with '_' at global scope|it starts with '_' and has C language linkage|it starts with '__'|it starts with '_' followed by a capital letter|it contains '__'}1
    • -
    • warning: macro name is a reserved identifier
    • +
    • warning: static %select{function|variable}0 %1 is used in an inline function with external linkage
    • +
    • warning: static %select{function|variable}0 %1 is used in an inline function with external linkage

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-reserved-user-defined-literal - clang-diagnostic-reserved-user-defined-literal + clang-diagnostic-static-local-in-inline + clang-diagnostic-static-local-in-inline Diagnostic text:

      -
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    • -
    • warning: invalid suffix on literal; C++11 requires a space between literal and identifier
    • -
    • warning: invalid suffix on literal; C++11 requires a space between literal and identifier
    • +
    • warning: non-constant static local variable in inline function may be different in different files

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-restrict-expansion - clang-diagnostic-restrict-expansion + clang-diagnostic-strict-prototypes + clang-diagnostic-strict-prototypes Diagnostic text:

      -
    • warning: macro %0 has been marked as unsafe for use in headers%select{|: %2}1
    • +
    • warning: a %select{function|block}0 declaration without a prototype is deprecated %select{in all versions of C|}0
    • +
    • warning: a function %select{declaration|definition}0 without a prototype is deprecated in all versions of C %select{and is not supported in C23|and is treated as a zero-parameter prototype in C23, conflicting with a %select{previous|subsequent}2 %select{declaration|definition}3}1
    • +
    • warning: passing arguments to %select{a function|%1}0 without a prototype is deprecated in all versions of C and is not supported in C23

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-return-stack-address - clang-diagnostic-return-stack-address + clang-diagnostic-strict-selector-match + clang-diagnostic-strict-selector-match Diagnostic text:

      -
    • warning: %select{address of|reference to}0 stack memory associated with %select{local variable|parameter}2 %1 returned
    • -
    • warning: returning %select{address of|reference to}0 local temporary object
    • -
    • warning: returning address of label, which is local
    • +
    • warning: multiple methods named %0 found

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-return-std-move - clang-diagnostic-return-std-move + clang-diagnostic-string-compare + clang-diagnostic-string-compare Diagnostic text:

      -
    • warning: local variable %0 will be copied despite being %select{returned|thrown}1 by name
    • +
    • warning: result of comparison against %select{a string literal|@encode}0 is unspecified (use an explicit string comparison function instead)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-return-type - clang-diagnostic-return-type + clang-diagnostic-string-concatenation + clang-diagnostic-string-concatenation Diagnostic text:

      -
    • warning: %0 has C-linkage specified, but returns incomplete type %1 which could be incompatible with C
    • -
    • warning: %0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C
    • -
    • warning: %select{void function|void method|constructor|destructor}1 %0 should not return a value
    • -
    • warning: non-void %select{function|method}1 %0 should return a value
    • -
    • warning: non-void %select{function|method}1 %0 should return a value
    • -
    • warning: non-void coroutine does not return a value
    • -
    • warning: non-void coroutine does not return a value in all control paths
    • -
    • warning: non-void function does not return a value
    • -
    • warning: non-void function does not return a value in all control paths
    • -
    • warning: non-void lambda does not return a value
    • -
    • warning: non-void lambda does not return a value in all control paths
    • +
    • warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-return-type-c-linkage - clang-diagnostic-return-type-c-linkage + clang-diagnostic-string-conversion + clang-diagnostic-string-conversion Diagnostic text:

      -
    • warning: %0 has C-linkage specified, but returns incomplete type %1 which could be incompatible with C
    • -
    • warning: %0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C
    • +
    • warning: implicit conversion turns string literal into bool: %0 to %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-round-trip-cc1-args - clang-diagnostic-round-trip-cc1-args + clang-diagnostic-string-plus-char + clang-diagnostic-string-plus-char Diagnostic text:

      -
    • remark: generated arguments #%0 in round-trip: %1
    • +
    • warning: adding %0 to a string pointer does not append to the string

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-sanitize-address - clang-diagnostic-sanitize-address + clang-diagnostic-string-plus-int + clang-diagnostic-string-plus-int Diagnostic text:

      -
    • remark: -fsanitize-address-field-padding applied to %0
    • -
    • remark: -fsanitize-address-field-padding ignored for %0 because it %select{is not C++|is packed|is a union|is trivially copyable|has trivial destructor|is standard layout|is in a ignorelisted file|is ignorelisted}1
    • +
    • warning: adding %0 to a string does not append to the string

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-section - clang-diagnostic-section + clang-diagnostic-strncat-size + clang-diagnostic-strncat-size Diagnostic text:

      -
    • warning: %select{codeseg|section}0 does not match previous declaration
    • -
    • warning: duplicate code segment specifiers
    • -
    • warning: section attribute is specified on redeclared variable
    • +
    • warning: size argument in 'strncat' call appears to be size of the source
    • +
    • warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow
    • +
    • warning: the value of the size argument to 'strncat' is wrong

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-cast-of-sel-type - clang-diagnostic-cast-of-sel-type + clang-diagnostic-super-class-method-mismatch + clang-diagnostic-super-class-method-mismatch Diagnostic text:

      -
    • warning: cast of type %0 to %1 is deprecated; use sel_getName instead
    • +
    • warning: method parameter type %diff{$ does not match super class method parameter type $|does not match super class method parameter type}0,1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-selector - clang-diagnostic-selector + clang-diagnostic-suspicious-bzero + clang-diagnostic-suspicious-bzero Diagnostic text:

      -
    • warning: no method with selector %0 is implemented in this translation unit
    • -
    • warning: several methods with selector %0 of mismatched types are found for the @selector expression
    • +
    • warning: 'size' argument to bzero is '0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-selector-type-mismatch - clang-diagnostic-selector-type-mismatch + clang-diagnostic-suspicious-memaccess + clang-diagnostic-suspicious-memaccess Diagnostic text:

      -
    • warning: several methods with selector %0 of mismatched types are found for the @selector expression
    • +
    • warning: %select{'size' argument to memset is '0'|setting buffer to a 'sizeof' expression}0; did you mean to transpose the last two arguments?
    • +
    • warning: %select{destination for|source of|first operand of|second operand of}0 this %1 call is a pointer to %select{|class containing a }2dynamic class %3; vtable pointer will be %select{overwritten|copied|moved|compared}4
    • +
    • warning: %select{destination for|source of|first operand of|second operand of}0 this %1 call is a pointer to record %2 that is not trivial to %select{primitive-default-initialize|primitive-copy}3
    • +
    • warning: '%0' call operates on objects of type %1 while the size is based on a different type %2
    • +
    • warning: 'size' argument to bzero is '0'
    • +
    • warning: argument to 'sizeof' in %0 call is the same pointer type %1 as the %select{destination|source}2; expected %3 or an explicit length

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-self-assign - clang-diagnostic-self-assign + clang-diagnostic-swift-name-attribute + clang-diagnostic-swift-name-attribute Diagnostic text:

      -
    • warning: assigning %select{field|instance variable}0 to itself
    • -
    • warning: explicitly assigning value of variable of type %0 to itself
    • -
    • warning: explicitly assigning value of variable of type %0 to itself
    • +
    • warning: %0 attribute argument must be a string literal specifying a Swift function name
    • +
    • warning: %0 attribute cannot be applied to a %select{function|method}1 with no parameters
    • +
    • warning: %0 attribute cannot be applied to this declaration
    • +
    • warning: %0 attribute cannot specify more than one 'self:' parameter
    • +
    • warning: %0 attribute for 'subscript' getter cannot have a 'newValue:' parameter
    • +
    • warning: %0 attribute for 'subscript' must %select{be a getter or setter|have at least one parameter|have a 'self:' parameter}1
    • +
    • warning: %0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters
    • +
    • warning: %0 attribute for 'subscript' setter must have a 'newValue:' parameter
    • +
    • warning: %0 attribute for getter must not have any parameters besides 'self:'
    • +
    • warning: %0 attribute for setter must have one parameter for new value
    • +
    • warning: %0 attribute has invalid identifier for the %select{base|context|parameter}1 name
    • +
    • warning: %0 attribute is missing parameter label clause
    • +
    • warning: too %select{few|many}0 parameters in the signature specified by the %1 attribute (expected %2; got %3)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-self-assign-field - clang-diagnostic-self-assign-field + clang-diagnostic-switch + clang-diagnostic-switch Diagnostic text:

      -
    • warning: assigning %select{field|instance variable}0 to itself
    • +
    • warning: %plural{1:enumeration value %1 not handled in switch|2:enumeration values %1 and %2 not handled in switch|3:enumeration values %1, %2, and %3 not handled in switch|:%0 enumeration values not handled in switch: %1, %2, %3...}0
    • +
    • warning: case value not in enumerated type %0
    • +
    • warning: overflow converting case value to switch condition type (%0 to %1)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-self-assign-overloaded - clang-diagnostic-self-assign-overloaded + clang-diagnostic-switch-bool + clang-diagnostic-switch-bool Diagnostic text:

      -
    • warning: explicitly assigning value of variable of type %0 to itself
    • +
    • warning: switch condition has boolean value

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-self-move - clang-diagnostic-self-move + clang-diagnostic-switch-default + clang-diagnostic-switch-default Diagnostic text:

      -
    • warning: explicitly moving variable of type %0 to itself
    • +
    • warning: 'switch' missing 'default' label

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-semicolon-before-method-body - clang-diagnostic-semicolon-before-method-body + clang-diagnostic-switch-enum + clang-diagnostic-switch-enum Diagnostic text:

      -
    • warning: semicolon before method body is ignored
    • +
    • warning: %plural{1:enumeration value %1 not explicitly handled in switch|2:enumeration values %1 and %2 not explicitly handled in switch|3:enumeration values %1, %2, and %3 not explicitly handled in switch|:%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-sentinel - clang-diagnostic-sentinel + clang-diagnostic-sync-alignment + clang-diagnostic-sync-alignment Diagnostic text:

      -
    • warning: missing sentinel in %select{function call|method dispatch|block call}0
    • -
    • warning: not enough variable arguments in %0 declaration to fit a sentinel
    • +
    • warning: __sync builtin operation MUST have natural alignment (consider using __atomic).

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-serialized-diagnostics - clang-diagnostic-serialized-diagnostics + clang-diagnostic-target-clones-mixed-specifiers + clang-diagnostic-target-clones-mixed-specifiers Diagnostic text:

      -
    • warning: Received warning after diagnostic serialization teardown was underway: %0
    • -
    • warning: unable to merge a subprocess's serialized diagnostics
    • -
    • warning: unable to open file %0 for serializing diagnostics (%1)
    • +
    • warning: mixing 'target_clones' specifier mechanisms is permitted for GCC compatibility; use a comma separated sequence of string literals, or a string literal containing a comma-separated list of versions

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shadow - clang-diagnostic-shadow + clang-diagnostic-tautological-bitwise-compare + clang-diagnostic-tautological-bitwise-compare Diagnostic text:

      -
    • warning: declaration shadows a %select{local variable|variable in %2|static data member of %2|field of %2|typedef in %2|type alias in %2|structured binding}1
    • -
    • warning: local declaration of %0 hides instance variable
    • -
    • warning: modifying constructor parameter %0 that shadows a field of %1
    • +
    • warning: bitwise comparison always evaluates to %select{false|true}0
    • +
    • warning: bitwise or with non-zero value always evaluates to true

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shadow-all - clang-diagnostic-shadow-all + clang-diagnostic-tautological-compare + clang-diagnostic-tautological-compare Diagnostic text:

      -
    • warning: %select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows member inherited from type %2
    • -
    • warning: constructor parameter %0 shadows the field %1 of %2
    • -
    • warning: declaration shadows a %select{local variable|variable in %2|static data member of %2|field of %2|typedef in %2|type alias in %2|structured binding}1
    • -
    • warning: declaration shadows a %select{local variable|variable in %2|static data member of %2|field of %2|typedef in %2|type alias in %2|structured binding}1
    • -
    • warning: local declaration of %0 hides instance variable
    • -
    • warning: modifying constructor parameter %0 that shadows a field of %1
    • -
    • warning: modifying constructor parameter %0 that shadows a field of %1
    • +
    • warning: %select{aligning a value|the result of checking whether a value is aligned}0 to 1 byte is %select{a no-op|always true}0
    • +
    • warning: %select{self-|array }0comparison always evaluates to %select{a constant|true|false|'std::strong_ordering::equal'}1
    • +
    • warning: '&&' of a value and its negation always evaluates to false
    • +
    • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • +
    • warning: '||' of a value and its negation always evaluates to true
    • +
    • warning: bitwise comparison always evaluates to %select{false|true}0
    • +
    • warning: bitwise or with non-zero value always evaluates to true
    • +
    • warning: comparison of %select{address of|function|array}0 '%1' %select{not |}2equal to a null pointer is always %select{true|false}2
    • +
    • warning: comparison of nonnull %select{function call|parameter}0 '%1' %select{not |}2equal to a null pointer is '%select{true|false}2' on first encounter
    • +
    • warning: converting the result of '<<' to a boolean always evaluates to %select{false|true}0
    • +
    • warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true'
    • +
    • warning: overlapping comparisons always evaluate to %select{false|true}0
    • +
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • +
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • +
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • +
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shadow-field - clang-diagnostic-shadow-field + clang-diagnostic-tautological-constant-compare + clang-diagnostic-tautological-constant-compare Diagnostic text:

      -
    • warning: %select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows member inherited from type %2
    • +
    • warning: converting the result of '<<' to a boolean always evaluates to %select{false|true}0
    • +
    • warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true'
    • +
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • +
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shadow-field-in-constructor - clang-diagnostic-shadow-field-in-constructor + clang-diagnostic-tautological-constant-in-range-compare + clang-diagnostic-tautological-constant-in-range-compare Diagnostic text:

      -
    • warning: constructor parameter %0 shadows the field %1 of %2
    • -
    • warning: modifying constructor parameter %0 that shadows a field of %1
    • +
    • warning: result of comparison %select{%3|%1}0 %2 %select{%1|%3}0 is always %4
    • +
    • warning: result of comparison of %select{%3|char expression}0 %2 %select{char expression|%3}0 is always %4, since char is interpreted as unsigned
    • +
    • warning: result of comparison of %select{%3|unsigned enum expression}0 %2 %select{unsigned enum expression|%3}0 is always %4
    • +
    • warning: result of comparison of %select{%3|unsigned expression}0 %2 %select{unsigned expression|%3}0 is always %4
    • +
    • warning: result of comparison of %select{%4|%sub{subst_int_range}1,2}0 %3 %select{%sub{subst_int_range}1,2|%4}0 is always %5

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shadow-field-in-constructor-modified - clang-diagnostic-shadow-field-in-constructor-modified + clang-diagnostic-tautological-negation-compare + clang-diagnostic-tautological-negation-compare Diagnostic text:

      -
    • warning: modifying constructor parameter %0 that shadows a field of %1
    • +
    • warning: '&&' of a value and its negation always evaluates to false
    • +
    • warning: '||' of a value and its negation always evaluates to true

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shadow-ivar - clang-diagnostic-shadow-ivar + clang-diagnostic-tautological-objc-bool-compare + clang-diagnostic-tautological-objc-bool-compare Diagnostic text:

      -
    • warning: local declaration of %0 hides instance variable
    • +
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shadow-uncaptured-local - clang-diagnostic-shadow-uncaptured-local + clang-diagnostic-tautological-constant-out-of-range-compare + clang-diagnostic-tautological-constant-out-of-range-compare Diagnostic text:

      -
    • warning: declaration shadows a %select{local variable|variable in %2|static data member of %2|field of %2|typedef in %2|type alias in %2|structured binding}1
    • +
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shift-op-parentheses - clang-diagnostic-shift-op-parentheses + clang-diagnostic-tautological-overlap-compare + clang-diagnostic-tautological-overlap-compare Diagnostic text:

      -
    • warning: operator '%0' has lower precedence than '%1'; '%1' will be evaluated first
    • +
    • warning: overlapping comparisons always evaluate to %select{false|true}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-shorten-64-to-32 - clang-diagnostic-shorten-64-to-32 + clang-diagnostic-tautological-pointer-compare + clang-diagnostic-tautological-pointer-compare Diagnostic text:

      -
    • warning: implicit conversion loses integer precision: %0 to %1
    • +
    • warning: comparison of %select{address of|function|array}0 '%1' %select{not |}2equal to a null pointer is always %select{true|false}2
    • +
    • warning: comparison of nonnull %select{function call|parameter}0 '%1' %select{not |}2equal to a null pointer is '%select{true|false}2' on first encounter

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-sign-compare - clang-diagnostic-sign-compare + clang-diagnostic-tautological-type-limit-compare + clang-diagnostic-tautological-type-limit-compare Diagnostic text:

      -
    • warning: comparison of integers of different signs: %0 and %1
    • +
    • warning: result of comparison %select{%3|%1}0 %2 %select{%1|%3}0 is always %4

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-sign-conversion - clang-diagnostic-sign-conversion + clang-diagnostic-tautological-undefined-compare + clang-diagnostic-tautological-undefined-compare Diagnostic text:

      -
    • warning: implicit conversion changes signedness: %0 to %1
    • -
    • warning: operand of ? changes signedness: %0 to %1
    • -
    • warning: the resulting value is always non-negative after implicit conversion
    • +
    • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • +
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-signed-enum-bitfield - clang-diagnostic-signed-enum-bitfield + clang-diagnostic-tautological-unsigned-char-zero-compare + clang-diagnostic-tautological-unsigned-char-zero-compare Diagnostic text:

      -
    • warning: enums in the Microsoft ABI are signed integers by default; consider giving the enum %0 an unsigned underlying type to make this code portable
    • +
    • warning: result of comparison of %select{%3|char expression}0 %2 %select{char expression|%3}0 is always %4, since char is interpreted as unsigned

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-sizeof-array-argument - clang-diagnostic-sizeof-array-argument + clang-diagnostic-tautological-unsigned-enum-zero-compare + clang-diagnostic-tautological-unsigned-enum-zero-compare Diagnostic text:

      -
    • warning: sizeof on array function parameter will return size of %0 instead of %1
    • +
    • warning: result of comparison of %select{%3|unsigned enum expression}0 %2 %select{unsigned enum expression|%3}0 is always %4

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-sizeof-array-decay - clang-diagnostic-sizeof-array-decay + clang-diagnostic-tautological-unsigned-zero-compare + clang-diagnostic-tautological-unsigned-zero-compare Diagnostic text:

      -
    • warning: sizeof on pointer operation will return size of %0 instead of %1
    • +
    • warning: result of comparison of %select{%3|unsigned expression}0 %2 %select{unsigned expression|%3}0 is always %4

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-sizeof-pointer-memaccess - clang-diagnostic-sizeof-pointer-memaccess + clang-diagnostic-tautological-value-range-compare + clang-diagnostic-tautological-value-range-compare Diagnostic text:

      -
    • warning: '%0' call operates on objects of type %1 while the size is based on a different type %2
    • -
    • warning: argument to 'sizeof' in %0 call is the same pointer type %1 as the %select{destination|source}2; expected %3 or an explicit length
    • +
    • warning: result of comparison of %select{%4|%sub{subst_int_range}1,2}0 %3 %select{%sub{subst_int_range}1,2|%4}0 is always %5

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-source-uses-openmp - clang-diagnostic-source-uses-openmp + clang-diagnostic-thread-safety + clang-diagnostic-thread-safety Diagnostic text:

      -
    • warning: '#pragma omp declare variant' cannot be applied for function after first usage; the original function might be used
    • -
    • warning: '#pragma omp declare variant' cannot be applied to the function that was defined already; the original function might be used
    • -
    • warning: OpenMP only allows an ordered construct with the simd clause nested in a simd construct
    • -
    • warning: isa trait '%0' is not known to the current target; verify the spelling or consider restricting the context selector with the 'arch' selector further
    • -
    • warning: score expressions in the OpenMP context selector need to be constant; %0 is not and will be ignored
    • -
    • warning: unexpected '#pragma omp ...' in program
    • -
    • warning: variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'
    • +
    • warning: %0 '%1' is acquired exclusively and shared in the same scope
    • +
    • warning: %0 '%1' is not held on every path through here
    • +
    • warning: %0 '%1' is still held at the end of function
    • +
    • warning: %0 '%1' must be acquired before '%2'
    • +
    • warning: %0 attribute can only be applied in a context annotated with 'capability' attribute
    • +
    • warning: %0 attribute requires arguments whose type is annotated with 'capability' attribute; type here is %1
    • +
    • warning: %0 attribute without capability arguments can only be applied to non-static methods of a class
    • +
    • warning: %0 attribute without capability arguments refers to 'this', but %1 isn't annotated with 'capability' or 'scoped_lockable' attribute
    • +
    • warning: %0 only applies to pointer types; type here is %1
    • +
    • warning: %select{reading|writing}1 the value pointed to by %0 requires holding %select{any mutex|any mutex exclusively}1
    • +
    • warning: %select{reading|writing}1 variable %0 requires holding %select{any mutex|any mutex exclusively}1
    • +
    • warning: %select{reading|writing}3 the value pointed to by %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: %select{reading|writing}3 the value pointed to by %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: %select{reading|writing}3 variable %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: %select{reading|writing}3 variable %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: Cycle in acquired_before/after dependencies, starting with '%0'
    • +
    • warning: acquiring %0 '%1' that is already held
    • +
    • warning: calling function %0 requires negative capability '%1'
    • +
    • warning: calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: cannot call function '%1' while %0 '%2' is held
    • +
    • warning: cannot resolve lock expression
    • +
    • warning: expecting %0 '%1' to be held at start of each loop
    • +
    • warning: expecting %0 '%1' to be held at the end of function
    • +
    • warning: ignoring %0 attribute because its argument is invalid
    • +
    • warning: passing the value that %1 points to by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: passing variable %1 by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: releasing %0 '%1' that was not held
    • +
    • warning: releasing %0 '%1' using %select{shared|exclusive}2 access, expected %select{shared|exclusive}3 access
    • +
    • warning: returning the value that %1 points to by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: returning variable %1 by reference requires holding %0 %select{'%2'|'%2' exclusively}3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-spir-compat - clang-diagnostic-spir-compat + clang-diagnostic-thread-safety-analysis + clang-diagnostic-thread-safety-analysis Diagnostic text:

      -
    • warning: sampler initializer has invalid %0 bits
    • +
    • warning: %0 '%1' is acquired exclusively and shared in the same scope
    • +
    • warning: %0 '%1' is not held on every path through here
    • +
    • warning: %0 '%1' is still held at the end of function
    • +
    • warning: %0 '%1' must be acquired before '%2'
    • +
    • warning: %select{reading|writing}1 the value pointed to by %0 requires holding %select{any mutex|any mutex exclusively}1
    • +
    • warning: %select{reading|writing}1 variable %0 requires holding %select{any mutex|any mutex exclusively}1
    • +
    • warning: %select{reading|writing}3 the value pointed to by %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: %select{reading|writing}3 variable %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: Cycle in acquired_before/after dependencies, starting with '%0'
    • +
    • warning: acquiring %0 '%1' that is already held
    • +
    • warning: calling function %0 requires negative capability '%1'
    • +
    • warning: calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: cannot call function '%1' while %0 '%2' is held
    • +
    • warning: cannot resolve lock expression
    • +
    • warning: expecting %0 '%1' to be held at start of each loop
    • +
    • warning: expecting %0 '%1' to be held at the end of function
    • +
    • warning: releasing %0 '%1' that was not held
    • +
    • warning: releasing %0 '%1' using %select{shared|exclusive}2 access, expected %select{shared|exclusive}3 access

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-static-float-init - clang-diagnostic-static-float-init + clang-diagnostic-thread-safety-attributes + clang-diagnostic-thread-safety-attributes Diagnostic text:

      -
    • warning: in-class initializer for static data member of type %0 is a GNU extension
    • -
    • warning: in-class initializer for static data member of type %0 requires 'constexpr' specifier
    • +
    • warning: %0 attribute can only be applied in a context annotated with 'capability' attribute
    • +
    • warning: %0 attribute requires arguments whose type is annotated with 'capability' attribute; type here is %1
    • +
    • warning: %0 attribute without capability arguments can only be applied to non-static methods of a class
    • +
    • warning: %0 attribute without capability arguments refers to 'this', but %1 isn't annotated with 'capability' or 'scoped_lockable' attribute
    • +
    • warning: %0 only applies to pointer types; type here is %1
    • +
    • warning: ignoring %0 attribute because its argument is invalid

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-static-in-inline - clang-diagnostic-static-in-inline + clang-diagnostic-thread-safety-beta + clang-diagnostic-thread-safety-beta Diagnostic text:

      -
    • warning: static %select{function|variable}0 %1 is used in an inline function with external linkage
    • -
    • warning: static %select{function|variable}0 %1 is used in an inline function with external linkage
    • +
    • warning: thread safety beta warning

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-static-local-in-inline - clang-diagnostic-static-local-in-inline + clang-diagnostic-thread-safety-negative + clang-diagnostic-thread-safety-negative Diagnostic text:

      -
    • warning: non-constant static local variable in inline function may be different in different files
    • +
    • warning: acquiring %0 '%1' requires negative capability '%2'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-strict-selector-match - clang-diagnostic-strict-selector-match + clang-diagnostic-thread-safety-precise + clang-diagnostic-thread-safety-precise Diagnostic text:

      -
    • warning: multiple methods named %0 found
    • +
    • warning: %select{reading|writing}3 the value pointed to by %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: %select{reading|writing}3 variable %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-string-compare - clang-diagnostic-string-compare + clang-diagnostic-thread-safety-reference + clang-diagnostic-thread-safety-reference Diagnostic text:

      -
    • warning: result of comparison against %select{a string literal|@encode}0 is unspecified (use an explicit string comparison function instead)
    • +
    • warning: passing the value that %1 points to by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: passing variable %1 by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: returning the value that %1 points to by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: returning variable %1 by reference requires holding %0 %select{'%2'|'%2' exclusively}3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-string-concatenation - clang-diagnostic-string-concatenation + clang-diagnostic-thread-safety-reference-return + clang-diagnostic-thread-safety-reference-return Diagnostic text:

      -
    • warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?
    • +
    • warning: returning the value that %1 points to by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: returning variable %1 by reference requires holding %0 %select{'%2'|'%2' exclusively}3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-string-conversion - clang-diagnostic-string-conversion + clang-diagnostic-thread-safety-verbose + clang-diagnostic-thread-safety-verbose Diagnostic text:

      -
    • warning: implicit conversion turns string literal into bool: %0 to %1
    • +
    • warning: thread safety verbose warning

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-string-plus-char - clang-diagnostic-string-plus-char + clang-diagnostic-trigraphs + clang-diagnostic-trigraphs Diagnostic text:

      -
    • warning: adding %0 to a string pointer does not append to the string
    • +
    • warning: ignored trigraph would end block comment
    • +
    • warning: trigraph converted to '%0' character
    • +
    • warning: trigraph ends block comment
    • +
    • warning: trigraph ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-string-plus-int - clang-diagnostic-string-plus-int + clang-diagnostic-type-limits + clang-diagnostic-type-limits Diagnostic text:

      -
    • warning: adding %0 to a string does not append to the string
    • +
    • warning: result of comparison %select{%3|%1}0 %2 %select{%1|%3}0 is always %4
    • +
    • warning: result of comparison of %select{%3|char expression}0 %2 %select{char expression|%3}0 is always %4, since char is interpreted as unsigned
    • +
    • warning: result of comparison of %select{%3|unsigned enum expression}0 %2 %select{unsigned enum expression|%3}0 is always %4
    • +
    • warning: result of comparison of %select{%3|unsigned expression}0 %2 %select{unsigned expression|%3}0 is always %4

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-strncat-size - clang-diagnostic-strncat-size + clang-diagnostic-type-safety + clang-diagnostic-type-safety Diagnostic text:

      -
    • warning: size argument in 'strncat' call appears to be size of the source
    • -
    • warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow
    • -
    • warning: the value of the size argument to 'strncat' is wrong
    • +
    • warning: argument type %0 doesn't match specified %1 type tag %select{that requires %3|}2
    • +
    • warning: specified %0 type tag requires a null pointer
    • +
    • warning: this type tag was not designed to be used with this function

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-super-class-method-mismatch - clang-diagnostic-super-class-method-mismatch + clang-diagnostic-unaligned-access + clang-diagnostic-unaligned-access Diagnostic text:

      -
    • warning: method parameter type %diff{$ does not match super class method parameter type $|does not match super class method parameter type}0,1
    • +
    • warning: field %1 within %0 is less aligned than %2 and is usually due to %0 being packed, which can lead to unaligned accesses

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-suspicious-bzero - clang-diagnostic-suspicious-bzero + clang-diagnostic-unavailable-declarations + clang-diagnostic-unavailable-declarations Diagnostic text:

      -
    • warning: 'size' argument to bzero is '0'
    • +
    • warning: %0 may be unavailable because the receiver type is unknown

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-suspicious-memaccess - clang-diagnostic-suspicious-memaccess + clang-diagnostic-undeclared-selector + clang-diagnostic-undeclared-selector Diagnostic text:

      -
    • warning: %select{'size' argument to memset is '0'|setting buffer to a 'sizeof' expression}0; did you mean to transpose the last two arguments?
    • -
    • warning: %select{destination for|source of|first operand of|second operand of}0 this %1 call is a pointer to %select{|class containing a }2dynamic class %3; vtable pointer will be %select{overwritten|copied|moved|compared}4
    • -
    • warning: %select{destination for|source of|first operand of|second operand of}0 this %1 call is a pointer to record %2 that is not trivial to %select{primitive-default-initialize|primitive-copy}3
    • -
    • warning: '%0' call operates on objects of type %1 while the size is based on a different type %2
    • -
    • warning: 'size' argument to bzero is '0'
    • -
    • warning: argument to 'sizeof' in %0 call is the same pointer type %1 as the %select{destination|source}2; expected %3 or an explicit length
    • +
    • warning: undeclared selector %0
    • +
    • warning: undeclared selector %0; did you mean %1?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-swift-name-attribute - clang-diagnostic-swift-name-attribute + clang-diagnostic-undefined-bool-conversion + clang-diagnostic-undefined-bool-conversion Diagnostic text:

      -
    • warning: %0 attribute argument must be a string literal specifying a Swift function name
    • -
    • warning: %0 attribute cannot be applied to a %select{function|method}1 with no parameters
    • -
    • warning: %0 attribute cannot be applied to this declaration
    • -
    • warning: %0 attribute cannot specify more than one 'self:' parameter
    • -
    • warning: %0 attribute for 'subscript' getter cannot have a 'newValue:' parameter
    • -
    • warning: %0 attribute for 'subscript' must %select{be a getter or setter|have at least one parameter|have a 'self:' parameter}1
    • -
    • warning: %0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters
    • -
    • warning: %0 attribute for 'subscript' setter must have a 'newValue:' parameter
    • -
    • warning: %0 attribute for getter must not have any parameters besides 'self:'
    • -
    • warning: %0 attribute for setter must have one parameter for new value
    • -
    • warning: %0 attribute has invalid identifier for the %select{base|context|parameter}1 name
    • -
    • warning: %0 attribute is missing parameter label clause
    • -
    • warning: too %select{few|many}0 parameters in the signature specified by the %1 attribute (expected %2; got %3)
    • +
    • warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-switch - clang-diagnostic-switch + clang-diagnostic-undefined-func-template + clang-diagnostic-undefined-func-template Diagnostic text:

      -
    • warning: %plural{1:enumeration value %1 not handled in switch|2:enumeration values %1 and %2 not handled in switch|3:enumeration values %1, %2, and %3 not handled in switch|:%0 enumeration values not handled in switch: %1, %2, %3...}0
    • -
    • warning: case value not in enumerated type %0
    • -
    • warning: overflow converting case value to switch condition type (%0 to %1)
    • +
    • warning: instantiation of function %q0 required here, but no definition is available

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-switch-bool - clang-diagnostic-switch-bool + clang-diagnostic-undefined-reinterpret-cast + clang-diagnostic-undefined-reinterpret-cast Diagnostic text:

      -
    • warning: switch condition has boolean value
    • +
    • warning: dereference of type %1 that was reinterpret_cast from type %0 has undefined behavior
    • +
    • warning: reinterpret_cast from %0 to %1 has undefined behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-switch-enum - clang-diagnostic-switch-enum + clang-diagnostic-undefined-var-template + clang-diagnostic-undefined-var-template Diagnostic text:

      -
    • warning: %plural{1:enumeration value %1 not explicitly handled in switch|2:enumeration values %1 and %2 not explicitly handled in switch|3:enumeration values %1, %2, and %3 not explicitly handled in switch|:%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0
    • +
    • warning: instantiation of variable %q0 required here, but no definition is available

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-target-clones-mixed-specifiers - clang-diagnostic-target-clones-mixed-specifiers + clang-diagnostic-underaligned-exception-object + clang-diagnostic-underaligned-exception-object Diagnostic text:

      -
    • warning: mixing 'target_clones' specifier mechanisms is permitted for GCC compatibility; use a comma separated sequence of string literals, or a string literal containing a comma-separated list of versions
    • +
    • warning: underaligned exception object thrown

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-bitwise-compare - clang-diagnostic-tautological-bitwise-compare + clang-diagnostic-unevaluated-expression + clang-diagnostic-unevaluated-expression Diagnostic text:

      -
    • warning: bitwise comparison always evaluates to %select{false|true}0
    • -
    • warning: bitwise or with non-zero value always evaluates to true
    • +
    • warning: expression with side effects has no effect in an unevaluated context
    • +
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-compare - clang-diagnostic-tautological-compare + clang-diagnostic-unguarded-availability + clang-diagnostic-unguarded-availability Diagnostic text:

      -
    • warning: %select{aligning a value|the result of checking whether a value is aligned}0 to 1 byte is %select{a no-op|always true}0
    • -
    • warning: %select{self-|array }0comparison always evaluates to %select{a constant|true|false|'std::strong_ordering::equal'}1
    • -
    • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • -
    • warning: bitwise comparison always evaluates to %select{false|true}0
    • -
    • warning: bitwise or with non-zero value always evaluates to true
    • -
    • warning: comparison of %select{address of|function|array}0 '%1' %select{not |}2equal to a null pointer is always %select{true|false}2
    • -
    • warning: comparison of nonnull %select{function call|parameter}0 '%1' %select{not |}2equal to a null pointer is '%select{true|false}2' on first encounter
    • -
    • warning: converting the result of '<<' to a boolean always evaluates to %select{false|true}0
    • -
    • warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true'
    • -
    • warning: overlapping comparisons always evaluate to %select{false|true}0
    • -
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • -
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: %0 is only available on %1 %2 or newer
    • +
    • warning: %0 is only available on %1 %2 or newer

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-constant-compare - clang-diagnostic-tautological-constant-compare + clang-diagnostic-unguarded-availability-new + clang-diagnostic-unguarded-availability-new Diagnostic text:

      -
    • warning: converting the result of '<<' to a boolean always evaluates to %select{false|true}0
    • -
    • warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true'
    • -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • +
    • warning: %0 is only available on %1 %2 or newer

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-constant-in-range-compare - clang-diagnostic-tautological-constant-in-range-compare + clang-diagnostic-unicode + clang-diagnostic-unicode Diagnostic text:

      -
    • warning: result of comparison %select{%3|%1}0 %2 %select{%1|%3}0 is always %4
    • -
    • warning: result of comparison of %select{%3|char expression}0 %2 %select{char expression|%3}0 is always %4, since char is interpreted as unsigned
    • -
    • warning: result of comparison of %select{%3|unsigned enum expression}0 %2 %select{unsigned enum expression|%3}0 is always %4
    • -
    • warning: result of comparison of %select{%3|unsigned expression}0 %2 %select{unsigned expression|%3}0 is always %4
    • -
    • warning: result of comparison of %select{%4|%sub{subst_int_range}1,2}0 %3 %select{%sub{subst_int_range}1,2|%4}0 is always %5
    • +
    • warning: \%0 used with no following hex digits; treating as '\' followed by identifier
    • +
    • warning: empty delimited universal character name; treating as '\' '%0' '{' '}'
    • +
    • warning: incomplete delimited universal character name; treating as '\' '%0' '{' identifier
    • +
    • warning: incomplete universal character name; treating as '\' followed by identifier
    • +
    • warning: universal character name refers to a surrogate character
    • +
    • warning: universal character names are only valid in C99 or C++
    • +
    • warning: universal character names are only valid in C99 or C++; treating as '\' followed by identifier

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-objc-bool-compare - clang-diagnostic-tautological-objc-bool-compare + clang-diagnostic-uninitialized + clang-diagnostic-uninitialized Diagnostic text:

      -
    • warning: result of comparison of constant %0 with expression of type 'BOOL' is always %1, as the only well defined values for 'BOOL' are YES and NO
    • +
    • warning: base class %0 is uninitialized when used here to access %q1
    • +
    • warning: block pointer variable %0 is %select{uninitialized|null}1 when captured by block
    • +
    • warning: field %0 is uninitialized when used here
    • +
    • warning: reference %0 is not yet bound to a value when used here
    • +
    • warning: reference %0 is not yet bound to a value when used within its own initialization
    • +
    • warning: static variable %0 is suspiciously used within its own initialization
    • +
    • warning: variable %0 is %select{used|captured}1 uninitialized whenever %select{'%3' condition is %select{true|false}4|'%3' loop %select{is entered|exits because its condition is false}4|'%3' loop %select{condition is true|exits because its condition is false}4|switch %3 is taken|its declaration is reached|%3 is called}2
    • +
    • warning: variable %0 is uninitialized when %select{used here|captured by block}1
    • +
    • warning: variable %0 is uninitialized when passed as a const reference argument here
    • +
    • warning: variable %0 is uninitialized when used within its own initialization

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-constant-out-of-range-compare - clang-diagnostic-tautological-constant-out-of-range-compare + clang-diagnostic-uninitialized-const-reference + clang-diagnostic-uninitialized-const-reference Diagnostic text:

      -
    • warning: result of comparison of %select{constant %0|true|false}1 with %select{expression of type %2|boolean expression}3 is always %4
    • +
    • warning: variable %0 is uninitialized when passed as a const reference argument here

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-overlap-compare - clang-diagnostic-tautological-overlap-compare + clang-diagnostic-conditional-uninitialized + clang-diagnostic-conditional-uninitialized Diagnostic text:

      -
    • warning: overlapping comparisons always evaluate to %select{false|true}0
    • +
    • warning: variable %0 may be uninitialized when %select{used here|captured by block}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-pointer-compare - clang-diagnostic-tautological-pointer-compare + clang-diagnostic-sometimes-uninitialized + clang-diagnostic-sometimes-uninitialized Diagnostic text:

      -
    • warning: comparison of %select{address of|function|array}0 '%1' %select{not |}2equal to a null pointer is always %select{true|false}2
    • -
    • warning: comparison of nonnull %select{function call|parameter}0 '%1' %select{not |}2equal to a null pointer is '%select{true|false}2' on first encounter
    • +
    • warning: variable %0 is %select{used|captured}1 uninitialized whenever %select{'%3' condition is %select{true|false}4|'%3' loop %select{is entered|exits because its condition is false}4|'%3' loop %select{condition is true|exits because its condition is false}4|switch %3 is taken|its declaration is reached|%3 is called}2

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-type-limit-compare - clang-diagnostic-tautological-type-limit-compare + clang-diagnostic-static-self-init + clang-diagnostic-static-self-init Diagnostic text:

      -
    • warning: result of comparison %select{%3|%1}0 %2 %select{%1|%3}0 is always %4
    • +
    • warning: static variable %0 is suspiciously used within its own initialization

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-undefined-compare - clang-diagnostic-tautological-undefined-compare + clang-diagnostic-unknown-argument + clang-diagnostic-unknown-argument Diagnostic text:

      -
    • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • -
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
    • +
    • warning: joined argument treated as '%0'; did you mean '%1'?
    • +
    • warning: unknown argument ignored in clang-cl '%0'; did you mean '%1'?
    • +
    • warning: unknown argument ignored in clang-cl: '%0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-unsigned-char-zero-compare - clang-diagnostic-tautological-unsigned-char-zero-compare + clang-diagnostic-unknown-assumption + clang-diagnostic-unknown-assumption Diagnostic text:

      -
    • warning: result of comparison of %select{%3|char expression}0 %2 %select{char expression|%3}0 is always %4, since char is interpreted as unsigned
    • +
    • warning: unknown assumption string '%0'; attribute is potentially ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-unsigned-enum-zero-compare - clang-diagnostic-tautological-unsigned-enum-zero-compare + clang-diagnostic-unknown-attributes + clang-diagnostic-unknown-attributes Diagnostic text:

      -
    • warning: result of comparison of %select{%3|unsigned enum expression}0 %2 %select{unsigned enum expression|%3}0 is always %4
    • +
    • warning: unknown attribute %0 ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-unsigned-zero-compare - clang-diagnostic-tautological-unsigned-zero-compare + clang-diagnostic-unknown-pragmas + clang-diagnostic-unknown-pragmas Diagnostic text:

      -
    • warning: result of comparison of %select{%3|unsigned expression}0 %2 %select{unsigned expression|%3}0 is always %4
    • +
    • warning: #pragma execution_character_set expected '%0'
    • +
    • warning: #pragma execution_character_set expected 'push' or 'pop'
    • +
    • warning: #pragma execution_character_set invalid value '%0', only 'UTF-8' is supported
    • +
    • warning: #pragma warning expected '%0'
    • +
    • warning: #pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4
    • +
    • warning: #pragma warning expected a warning number
    • +
    • warning: #pragma warning(push, level) requires a level between 0 and 4
    • +
    • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
    • +
    • warning: double-quoted include "%0" cannot be aliased to angle-bracketed include <%1>
    • +
    • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
    • +
    • warning: expected end of directive in pragma
    • +
    • warning: pragma STDC FENV_ROUND is not supported
    • +
    • warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'
    • +
    • warning: pragma diagnostic expected option name (e.g. "-Wundef")
    • +
    • warning: pragma diagnostic pop could not pop, no matching push
    • +
    • warning: pragma include_alias expected '%0'
    • +
    • warning: pragma include_alias expected include filename
    • +
    • warning: unexpected token in pragma diagnostic
    • +
    • warning: unknown pragma ignored
    • +
    • warning: unknown pragma in STDC namespace

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-tautological-value-range-compare - clang-diagnostic-tautological-value-range-compare + clang-diagnostic-unknown-sanitizers + clang-diagnostic-unknown-sanitizers Diagnostic text:

      -
    • warning: result of comparison of %select{%4|%sub{subst_int_range}1,2}0 %3 %select{%sub{subst_int_range}1,2|%4}0 is always %5
    • +
    • warning: unknown sanitizer '%0' ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-thread-safety - clang-diagnostic-thread-safety + clang-diagnostic-unknown-warning-option + clang-diagnostic-unknown-warning-option Diagnostic text:

      -
    • warning: %0 '%1' is acquired exclusively and shared in the same scope
    • -
    • warning: %0 '%1' is not held on every path through here
    • -
    • warning: %0 '%1' is still held at the end of function
    • -
    • warning: %0 '%1' must be acquired before '%2'
    • -
    • warning: %0 attribute can only be applied in a context annotated with 'capability' attribute
    • -
    • warning: %0 attribute requires arguments whose type is annotated with 'capability' attribute; type here is %1
    • -
    • warning: %0 attribute without capability arguments can only be applied to non-static methods of a class
    • -
    • warning: %0 attribute without capability arguments refers to 'this', but %1 isn't annotated with 'capability' or 'scoped_lockable' attribute
    • -
    • warning: %0 only applies to pointer types; type here is %1
    • -
    • warning: %select{reading|writing}1 the value pointed to by %0 requires holding %select{any mutex|any mutex exclusively}1
    • -
    • warning: %select{reading|writing}1 variable %0 requires holding %select{any mutex|any mutex exclusively}1
    • -
    • warning: %select{reading|writing}3 the value pointed to by %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: %select{reading|writing}3 the value pointed to by %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: %select{reading|writing}3 variable %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: %select{reading|writing}3 variable %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: Cycle in acquired_before/after dependencies, starting with '%0'
    • -
    • warning: acquiring %0 '%1' that is already held
    • -
    • warning: calling function %0 requires negative capability '%1'
    • -
    • warning: calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: cannot call function '%1' while %0 '%2' is held
    • -
    • warning: cannot resolve lock expression
    • -
    • warning: expecting %0 '%1' to be held at start of each loop
    • -
    • warning: expecting %0 '%1' to be held at the end of function
    • -
    • warning: ignoring %0 attribute because its argument is invalid
    • -
    • warning: passing the value that %1 points to by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: passing variable %1 by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: releasing %0 '%1' that was not held
    • -
    • warning: releasing %0 '%1' using %select{shared|exclusive}2 access, expected %select{shared|exclusive}3 access
    • +
    • warning: unknown %0 warning specifier: '%1'
    • +
    • warning: unknown %select{warning|remark}0 option '%1'%select{|; did you mean '%3'?}2
    • +
    • warning: unknown warning group '%0', ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-thread-safety-analysis - clang-diagnostic-thread-safety-analysis + clang-diagnostic-unnamed-type-template-args + clang-diagnostic-unnamed-type-template-args Diagnostic text:

      -
    • warning: %0 '%1' is acquired exclusively and shared in the same scope
    • -
    • warning: %0 '%1' is not held on every path through here
    • -
    • warning: %0 '%1' is still held at the end of function
    • -
    • warning: %0 '%1' must be acquired before '%2'
    • -
    • warning: %select{reading|writing}1 the value pointed to by %0 requires holding %select{any mutex|any mutex exclusively}1
    • -
    • warning: %select{reading|writing}1 variable %0 requires holding %select{any mutex|any mutex exclusively}1
    • -
    • warning: %select{reading|writing}3 the value pointed to by %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: %select{reading|writing}3 variable %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: Cycle in acquired_before/after dependencies, starting with '%0'
    • -
    • warning: acquiring %0 '%1' that is already held
    • -
    • warning: calling function %0 requires negative capability '%1'
    • -
    • warning: calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: cannot call function '%1' while %0 '%2' is held
    • -
    • warning: cannot resolve lock expression
    • -
    • warning: expecting %0 '%1' to be held at start of each loop
    • -
    • warning: expecting %0 '%1' to be held at the end of function
    • -
    • warning: releasing %0 '%1' that was not held
    • -
    • warning: releasing %0 '%1' using %select{shared|exclusive}2 access, expected %select{shared|exclusive}3 access
    • +
    • warning: template argument uses unnamed type
    • +
    • warning: unnamed type as template argument is incompatible with C++98

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-thread-safety-attributes - clang-diagnostic-thread-safety-attributes + clang-diagnostic-unneeded-internal-declaration + clang-diagnostic-unneeded-internal-declaration Diagnostic text:

      -
    • warning: %0 attribute can only be applied in a context annotated with 'capability' attribute
    • -
    • warning: %0 attribute requires arguments whose type is annotated with 'capability' attribute; type here is %1
    • -
    • warning: %0 attribute without capability arguments can only be applied to non-static methods of a class
    • -
    • warning: %0 attribute without capability arguments refers to 'this', but %1 isn't annotated with 'capability' or 'scoped_lockable' attribute
    • -
    • warning: %0 only applies to pointer types; type here is %1
    • -
    • warning: ignoring %0 attribute because its argument is invalid
    • +
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • +
    • warning: 'static' function %0 declared in header file should be declared 'static inline'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-thread-safety-beta - clang-diagnostic-thread-safety-beta + clang-diagnostic-unneeded-member-function + clang-diagnostic-unneeded-member-function Diagnostic text:

      -
    • warning: thread safety beta warning
    • +
    • warning: member function %0 is not needed and will not be emitted

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-thread-safety-negative - clang-diagnostic-thread-safety-negative + clang-diagnostic-unreachable-code + clang-diagnostic-unreachable-code Diagnostic text:

      -
    • warning: acquiring %0 '%1' requires negative capability '%2'
    • +
    • warning: code will never be executed
    • +
    • warning: due to lvalue conversion of the controlling expression, association of type %0 will never be selected because it is %select{of array type|qualified}1
    • +
    • warning: fallthrough annotation in unreachable code
    • +
    • warning: loop will run at most once (loop increment never executed)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-thread-safety-precise - clang-diagnostic-thread-safety-precise + clang-diagnostic-unreachable-code-aggressive + clang-diagnostic-unreachable-code-aggressive Diagnostic text:

      -
    • warning: %select{reading|writing}3 the value pointed to by %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: %select{reading|writing}3 variable %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: 'break' will never be executed
    • +
    • warning: 'return' will never be executed
    • +
    • warning: code will never be executed
    • +
    • warning: due to lvalue conversion of the controlling expression, association of type %0 will never be selected because it is %select{of array type|qualified}1
    • +
    • warning: fallthrough annotation in unreachable code
    • +
    • warning: loop will run at most once (loop increment never executed)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-thread-safety-reference - clang-diagnostic-thread-safety-reference + clang-diagnostic-unreachable-code-break + clang-diagnostic-unreachable-code-break Diagnostic text:

      -
    • warning: passing the value that %1 points to by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • -
    • warning: passing variable %1 by reference requires holding %0 %select{'%2'|'%2' exclusively}3
    • +
    • warning: 'break' will never be executed

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-thread-safety-verbose - clang-diagnostic-thread-safety-verbose + clang-diagnostic-unreachable-code-fallthrough + clang-diagnostic-unreachable-code-fallthrough Diagnostic text:

      -
    • warning: thread safety verbose warning
    • +
    • warning: fallthrough annotation in unreachable code

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-trigraphs - clang-diagnostic-trigraphs + clang-diagnostic-unreachable-code-generic-assoc + clang-diagnostic-unreachable-code-generic-assoc Diagnostic text:

      -
    • warning: ignored trigraph would end block comment
    • -
    • warning: trigraph converted to '%0' character
    • -
    • warning: trigraph ends block comment
    • -
    • warning: trigraph ignored
    • +
    • warning: due to lvalue conversion of the controlling expression, association of type %0 will never be selected because it is %select{of array type|qualified}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-type-limits - clang-diagnostic-type-limits + clang-diagnostic-unreachable-code-loop-increment + clang-diagnostic-unreachable-code-loop-increment Diagnostic text:

      -
    • warning: result of comparison %select{%3|%1}0 %2 %select{%1|%3}0 is always %4
    • -
    • warning: result of comparison of %select{%3|char expression}0 %2 %select{char expression|%3}0 is always %4, since char is interpreted as unsigned
    • -
    • warning: result of comparison of %select{%3|unsigned enum expression}0 %2 %select{unsigned enum expression|%3}0 is always %4
    • -
    • warning: result of comparison of %select{%3|unsigned expression}0 %2 %select{unsigned expression|%3}0 is always %4
    • +
    • warning: loop will run at most once (loop increment never executed)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-type-safety - clang-diagnostic-type-safety + clang-diagnostic-unreachable-code-return + clang-diagnostic-unreachable-code-return Diagnostic text:

      -
    • warning: argument type %0 doesn't match specified %1 type tag %select{that requires %3|}2
    • -
    • warning: specified %0 type tag requires a null pointer
    • -
    • warning: this type tag was not designed to be used with this function
    • +
    • warning: 'return' will never be executed

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unaligned-access - clang-diagnostic-unaligned-access + clang-diagnostic-unsafe-buffer-usage + clang-diagnostic-unsafe-buffer-usage Diagnostic text:

      -
    • warning: field %1 within %0 is less aligned than %2 and is usually due to %0 being packed, which can lead to unaligned accesses
    • +
    • warning: %0 is an %select{unsafe pointer used for buffer access|unsafe buffer that does not perform bounds checks}1
    • +
    • warning: %select{unsafe pointer operation|unsafe pointer arithmetic|unsafe buffer access|function introduces unsafe buffer manipulation|unsafe invocation of span::data}0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unavailable-declarations - clang-diagnostic-unavailable-declarations + clang-diagnostic-unsequenced + clang-diagnostic-unsequenced Diagnostic text:

      -
    • warning: %0 may be unavailable because the receiver type is unknown
    • +
    • warning: multiple unsequenced modifications to %0
    • +
    • warning: unsequenced modification and access to %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-undeclared-selector - clang-diagnostic-undeclared-selector + clang-diagnostic-unsupported-abi + clang-diagnostic-unsupported-abi Diagnostic text:

      -
    • warning: undeclared selector %0
    • -
    • warning: undeclared selector %0; did you mean %1?
    • +
    • warning: '%0': selected processor lacks floating point registers
    • +
    • warning: float ABI '%0' is not supported by current library

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-undefined-bool-conversion - clang-diagnostic-undefined-bool-conversion + clang-diagnostic-unsupported-abs + clang-diagnostic-unsupported-abs Diagnostic text:

      -
    • warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
    • -
    • warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true
    • +
    • warning: ignoring '-mabs=2008' option because the '%0' architecture does not support it
    • +
    • warning: ignoring '-mabs=legacy' option because the '%0' architecture does not support it

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-undefined-func-template - clang-diagnostic-undefined-func-template + clang-diagnostic-unsupported-cb + clang-diagnostic-unsupported-cb Diagnostic text:

      -
    • warning: instantiation of function %q0 required here, but no definition is available
    • +
    • warning: ignoring '-mcompact-branches=' option because the '%0' architecture does not support it

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-undefined-reinterpret-cast - clang-diagnostic-undefined-reinterpret-cast + clang-diagnostic-unsupported-floating-point-opt + clang-diagnostic-unsupported-floating-point-opt Diagnostic text:

      -
    • warning: dereference of type %1 that was reinterpret_cast from type %0 has undefined behavior
    • -
    • warning: reinterpret_cast from %0 to %1 has undefined behavior
    • +
    • warning: overriding currently unsupported rounding mode on this target
    • +
    • warning: overriding currently unsupported use of floating point exceptions on this target

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-undefined-var-template - clang-diagnostic-undefined-var-template + clang-diagnostic-unsupported-friend + clang-diagnostic-unsupported-friend Diagnostic text:

      -
    • warning: instantiation of variable %q0 required here, but no definition is available
    • +
    • warning: dependent nested name specifier '%0' for friend class declaration is not supported; turning off access control for %1
    • +
    • warning: dependent nested name specifier '%0' for friend template declaration is not supported; ignoring this friend declaration

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-underaligned-exception-object - clang-diagnostic-underaligned-exception-object + clang-diagnostic-unsupported-gpopt + clang-diagnostic-unsupported-gpopt Diagnostic text:

      -
    • warning: underaligned exception object thrown
    • +
    • warning: ignoring '-mgpopt' option as it cannot be used with %select{|the implicit usage of }0-mabicalls

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unevaluated-expression - clang-diagnostic-unevaluated-expression + clang-diagnostic-unsupported-nan + clang-diagnostic-unsupported-nan Diagnostic text:

      -
    • warning: expression with side effects has no effect in an unevaluated context
    • -
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
    • +
    • warning: ignoring '-mnan=2008' option because the '%0' architecture does not support it
    • +
    • warning: ignoring '-mnan=legacy' option because the '%0' architecture does not support it

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unguarded-availability - clang-diagnostic-unguarded-availability + clang-diagnostic-unsupported-target-opt + clang-diagnostic-unsupported-target-opt Diagnostic text:

      -
    • warning: %0 is only available on %1 %2 or newer
    • -
    • warning: %0 is only available on %1 %2 or newer
    • +
    • warning: debug information option '%0' is not supported for target '%1'
    • +
    • warning: debug information option '%0' is not supported; requires DWARF-%2 but target '%1' only provides DWARF-%3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unguarded-availability-new - clang-diagnostic-unguarded-availability-new + clang-diagnostic-unused + clang-diagnostic-unused Diagnostic text:

      -
    • warning: %0 is only available on %1 %2 or newer
    • +
    • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
    • +
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • +
    • warning: 'static' function %0 declared in header file should be declared 'static inline'
    • +
    • warning: container access result unused - container access should not be used for side effects
    • +
    • warning: expression result unused
    • +
    • warning: expression result unused; should this cast be to 'void'?
    • +
    • warning: expression with side effects has no effect in an unevaluated context
    • +
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
    • +
    • warning: ignoring return value of function declared with %0 attribute
    • +
    • warning: ignoring return value of function declared with %0 attribute
    • +
    • warning: ignoring return value of function declared with %0 attribute: %1
    • +
    • warning: ignoring temporary created by a constructor declared with %0 attribute
    • +
    • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
    • +
    • warning: ivar %0 which backs the property is not referenced in this property's accessor
    • +
    • warning: lambda capture %0 is not %select{used|required to be captured for this use}1
    • +
    • warning: left operand of comma operator has no effect
    • +
    • warning: private field %0 is not used
    • +
    • warning: unused %select{typedef|type alias}0 %1
    • +
    • warning: unused function %0
    • +
    • warning: unused label %0
    • +
    • warning: unused variable %0
    • +
    • warning: unused variable %0
    • +
    • warning: variable %0 set but not used

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unicode - clang-diagnostic-unicode + clang-diagnostic-unused-but-set-parameter + clang-diagnostic-unused-but-set-parameter Diagnostic text:

      -
    • warning: \%0 used with no following hex digits; treating as '\' followed by identifier
    • -
    • warning: empty delimited universal character name; treating as '\' 'u' '{' '}'
    • -
    • warning: incomplete delimited universal character name; treating as '\' 'u' '{' identifier
    • -
    • warning: incomplete universal character name; treating as '\' followed by identifier
    • -
    • warning: universal character name refers to a surrogate character
    • -
    • warning: universal character names are only valid in C99 or C++
    • -
    • warning: universal character names are only valid in C99 or C++; treating as '\' followed by identifier
    • +
    • warning: parameter %0 set but not used

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-uninitialized - clang-diagnostic-uninitialized + clang-diagnostic-unused-but-set-variable + clang-diagnostic-unused-but-set-variable Diagnostic text:

      -
    • warning: base class %0 is uninitialized when used here to access %q1
    • -
    • warning: block pointer variable %0 is %select{uninitialized|null}1 when captured by block
    • -
    • warning: field %0 is uninitialized when used here
    • -
    • warning: reference %0 is not yet bound to a value when used here
    • -
    • warning: reference %0 is not yet bound to a value when used within its own initialization
    • -
    • warning: static variable %0 is suspiciously used within its own initialization
    • -
    • warning: variable %0 is %select{used|captured}1 uninitialized whenever %select{'%3' condition is %select{true|false}4|'%3' loop %select{is entered|exits because its condition is false}4|'%3' loop %select{condition is true|exits because its condition is false}4|switch %3 is taken|its declaration is reached|%3 is called}2
    • -
    • warning: variable %0 is uninitialized when %select{used here|captured by block}1
    • -
    • warning: variable %0 is uninitialized when passed as a const reference argument here
    • -
    • warning: variable %0 is uninitialized when used within its own initialization
    • +
    • warning: variable %0 set but not used

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-uninitialized-const-reference - clang-diagnostic-uninitialized-const-reference + clang-diagnostic-unused-command-line-argument + clang-diagnostic-unused-command-line-argument Diagnostic text:

      -
    • warning: variable %0 is uninitialized when passed as a const reference argument here
    • +
    • warning: %0: '%1' input unused in cpp mode
    • +
    • warning: %0: '%1' input unused%select{ when '%3' is present|}2
    • +
    • warning: %0: previously preprocessed input%select{ unused when '%2' is present|}1
    • +
    • warning: '%0' only applies to medium and large code models
    • +
    • warning: '-x %0' after last input file has no effect
    • +
    • warning: argument '%0' requires profile-guided optimization information
    • +
    • warning: argument '%0' requires profile-guided optimization information
    • +
    • warning: argument unused during compilation: '%0'
    • +
    • warning: ignoring -fdiscard-value-names for LLVM Bitcode
    • +
    • warning: ignoring -fverify-debuginfo-preserve-export=%0 because -fverify-debuginfo-preserve wasn't enabled
    • +
    • warning: ignoring invalid /arch: argument '%0'; for %select{64|32}1-bit expected one of %2
    • +
    • warning: joined argument expects additional value: '%0'
    • +
    • warning: the flag '%0' has been deprecated and will be ignored

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-conditional-uninitialized - clang-diagnostic-conditional-uninitialized + clang-diagnostic-unused-comparison + clang-diagnostic-unused-comparison Diagnostic text:

      -
    • warning: variable %0 may be uninitialized when %select{used here|captured by block}1
    • +
    • warning: %select{equality|inequality|relational|three-way}0 comparison result unused

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-sometimes-uninitialized - clang-diagnostic-sometimes-uninitialized + clang-diagnostic-unused-const-variable + clang-diagnostic-unused-const-variable Diagnostic text:

      -
    • warning: variable %0 is %select{used|captured}1 uninitialized whenever %select{'%3' condition is %select{true|false}4|'%3' loop %select{is entered|exits because its condition is false}4|'%3' loop %select{condition is true|exits because its condition is false}4|switch %3 is taken|its declaration is reached|%3 is called}2
    • +
    • warning: unused variable %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-static-self-init - clang-diagnostic-static-self-init + clang-diagnostic-unused-exception-parameter + clang-diagnostic-unused-exception-parameter Diagnostic text:

      -
    • warning: static variable %0 is suspiciously used within its own initialization
    • +
    • warning: unused exception parameter %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unknown-argument - clang-diagnostic-unknown-argument + clang-diagnostic-unused-function + clang-diagnostic-unused-function Diagnostic text:

      -
    • warning: unknown argument ignored in clang-cl '%0'; did you mean '%1'?
    • -
    • warning: unknown argument ignored in clang-cl: '%0'
    • +
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • +
    • warning: 'static' function %0 declared in header file should be declared 'static inline'
    • +
    • warning: unused function %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unknown-assumption - clang-diagnostic-unknown-assumption + clang-diagnostic-unused-getter-return-value + clang-diagnostic-unused-getter-return-value Diagnostic text:

      -
    • warning: unknown assumption string '%0'; attribute is potentially ignored
    • +
    • warning: property access result unused - getters should not be used for side effects

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unknown-attributes - clang-diagnostic-unknown-attributes + clang-diagnostic-unused-label + clang-diagnostic-unused-label Diagnostic text:

      -
    • warning: unknown attribute %0 ignored
    • +
    • warning: unused label %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unknown-pragmas - clang-diagnostic-unknown-pragmas + clang-diagnostic-unused-lambda-capture + clang-diagnostic-unused-lambda-capture Diagnostic text:

      -
    • warning: #pragma execution_character_set expected '%0'
    • -
    • warning: #pragma execution_character_set expected 'push' or 'pop'
    • -
    • warning: #pragma execution_character_set invalid value '%0', only 'UTF-8' is supported
    • -
    • warning: #pragma warning expected '%0'
    • -
    • warning: #pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4
    • -
    • warning: #pragma warning expected a warning number
    • -
    • warning: #pragma warning(push, level) requires a level between 0 and 4
    • -
    • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
    • -
    • warning: double-quoted include "%0" cannot be aliased to angle-bracketed include <%1>
    • -
    • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
    • -
    • warning: expected end of directive in pragma
    • -
    • warning: pragma STDC FENV_ROUND is not supported
    • -
    • warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'
    • -
    • warning: pragma diagnostic expected option name (e.g. "-Wundef")
    • -
    • warning: pragma diagnostic pop could not pop, no matching push
    • -
    • warning: pragma include_alias expected '%0'
    • -
    • warning: pragma include_alias expected include filename
    • -
    • warning: unexpected token in pragma diagnostic
    • -
    • warning: unknown pragma ignored
    • -
    • warning: unknown pragma in STDC namespace
    • +
    • warning: lambda capture %0 is not %select{used|required to be captured for this use}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unknown-sanitizers - clang-diagnostic-unknown-sanitizers + clang-diagnostic-unused-local-typedef + clang-diagnostic-unused-local-typedef Diagnostic text:

      -
    • warning: unknown sanitizer '%0' ignored
    • +
    • warning: unused %select{typedef|type alias}0 %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unknown-warning-option - clang-diagnostic-unknown-warning-option + clang-diagnostic-unused-member-function + clang-diagnostic-unused-member-function Diagnostic text:

      -
    • warning: unknown %0 warning specifier: '%1'
    • -
    • warning: unknown %select{warning|remark}0 option '%1'%select{|; did you mean '%3'?}2
    • -
    • warning: unknown warning group '%0', ignored
    • +
    • warning: member function %0 is not needed and will not be emitted
    • +
    • warning: unused member function %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unnamed-type-template-args - clang-diagnostic-unnamed-type-template-args + clang-diagnostic-unused-parameter + clang-diagnostic-unused-parameter Diagnostic text:

      -
    • warning: template argument uses unnamed type
    • -
    • warning: unnamed type as template argument is incompatible with C++98
    • +
    • warning: unused parameter %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unneeded-internal-declaration - clang-diagnostic-unneeded-internal-declaration + clang-diagnostic-unused-private-field + clang-diagnostic-unused-private-field Diagnostic text:

      -
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • -
    • warning: 'static' function %0 declared in header file should be declared 'static inline'
    • +
    • warning: private field %0 is not used

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unneeded-member-function - clang-diagnostic-unneeded-member-function + clang-diagnostic-unused-property-ivar + clang-diagnostic-unused-property-ivar Diagnostic text:

      -
    • warning: member function %0 is not needed and will not be emitted
    • +
    • warning: ivar %0 which backs the property is not referenced in this property's accessor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unreachable-code - clang-diagnostic-unreachable-code + clang-diagnostic-unused-result + clang-diagnostic-unused-result Diagnostic text:

      -
    • warning: code will never be executed
    • -
    • warning: fallthrough annotation in unreachable code
    • -
    • warning: loop will run at most once (loop increment never executed)
    • +
    • warning: ignoring return value of function declared with %0 attribute
    • +
    • warning: ignoring return value of function declared with %0 attribute: %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unreachable-code-aggressive - clang-diagnostic-unreachable-code-aggressive + clang-diagnostic-unused-template + clang-diagnostic-unused-template Diagnostic text:

      -
    • warning: 'break' will never be executed
    • -
    • warning: 'return' will never be executed
    • -
    • warning: code will never be executed
    • -
    • warning: fallthrough annotation in unreachable code
    • -
    • warning: loop will run at most once (loop increment never executed)
    • +
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • +
    • warning: 'static' function %0 declared in header file should be declared 'static inline'
    • +
    • warning: unused %select{function|variable}0 template %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unreachable-code-break - clang-diagnostic-unreachable-code-break + clang-diagnostic-unused-value + clang-diagnostic-unused-value Diagnostic text:

      -
    • warning: 'break' will never be executed
    • +
    • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
    • +
    • warning: container access result unused - container access should not be used for side effects
    • +
    • warning: expression result unused
    • +
    • warning: expression result unused; should this cast be to 'void'?
    • +
    • warning: expression with side effects has no effect in an unevaluated context
    • +
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
    • +
    • warning: ignoring return value of function declared with %0 attribute
    • +
    • warning: ignoring return value of function declared with %0 attribute
    • +
    • warning: ignoring return value of function declared with %0 attribute: %1
    • +
    • warning: ignoring temporary created by a constructor declared with %0 attribute
    • +
    • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
    • +
    • warning: left operand of comma operator has no effect

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unreachable-code-fallthrough - clang-diagnostic-unreachable-code-fallthrough + clang-diagnostic-unused-variable + clang-diagnostic-unused-variable Diagnostic text:

      -
    • warning: fallthrough annotation in unreachable code
    • +
    • warning: unused variable %0
    • +
    • warning: unused variable %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unreachable-code-loop-increment - clang-diagnostic-unreachable-code-loop-increment + clang-diagnostic-used-but-marked-unused + clang-diagnostic-used-but-marked-unused Diagnostic text:

      -
    • warning: loop will run at most once (loop increment never executed)
    • +
    • warning: %0 was marked unused but was used

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unreachable-code-return - clang-diagnostic-unreachable-code-return + clang-diagnostic-search-path-usage + clang-diagnostic-search-path-usage Diagnostic text:

      -
    • warning: 'return' will never be executed
    • +
    • remark: search path used: '%0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsequenced - clang-diagnostic-unsequenced + clang-diagnostic-user-defined-literals + clang-diagnostic-user-defined-literals Diagnostic text:

      -
    • warning: multiple unsequenced modifications to %0
    • -
    • warning: unsequenced modification and access to %0
    • +
    • warning: user-defined literal suffixes %select{<ERROR>|not starting with '_'|containing '__'}0 are reserved%select{; no literal will invoke this operator|}1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsupported-abs - clang-diagnostic-unsupported-abs + clang-diagnostic-user-defined-warnings + clang-diagnostic-user-defined-warnings Diagnostic text:

      -
    • warning: ignoring '-mabs=2008' option because the '%0' architecture does not support it
    • -
    • warning: ignoring '-mabs=legacy' option because the '%0' architecture does not support it
    • +
    • warning: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsupported-cb - clang-diagnostic-unsupported-cb + clang-diagnostic-vla + clang-diagnostic-vla Diagnostic text:

      -
    • warning: ignoring '-mcompact-branches=' option because the '%0' architecture does not support it
    • +
    • warning: variable length array used
    • +
    • warning: variable length arrays are a C99 feature
    • +
    • warning: variable length arrays in C++ are a Clang extension
    • +
    • warning: variable length arrays in C++ are a Clang extension
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsupported-floating-point-opt - clang-diagnostic-unsupported-floating-point-opt + clang-diagnostic-vla-cxx-extension + clang-diagnostic-vla-cxx-extension Diagnostic text:

      -
    • warning: overriding currently unsupported rounding mode on this target
    • -
    • warning: overriding currently unsupported use of floating point exceptions on this target
    • +
    • warning: variable length arrays in C++ are a Clang extension
    • +
    • warning: variable length arrays in C++ are a Clang extension
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsupported-friend - clang-diagnostic-unsupported-friend + clang-diagnostic-vla-extension + clang-diagnostic-vla-extension Diagnostic text:

      -
    • warning: dependent nested name specifier '%0' for friend class declaration is not supported; turning off access control for %1
    • -
    • warning: dependent nested name specifier '%0' for friend template declaration is not supported; ignoring this friend declaration
    • +
    • warning: variable length arrays are a C99 feature
    • +
    • warning: variable length arrays in C++ are a Clang extension
    • +
    • warning: variable length arrays in C++ are a Clang extension
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsupported-gpopt - clang-diagnostic-unsupported-gpopt + clang-diagnostic-vla-extension-static-assert + clang-diagnostic-vla-extension-static-assert Diagnostic text:

      -
    • warning: ignoring '-mgpopt' option as it cannot be used with %select{|the implicit usage of }0-mabicalls
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
    • +
    • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsupported-nan - clang-diagnostic-unsupported-nan + clang-diagnostic-varargs + clang-diagnostic-varargs Diagnostic text:

      -
    • warning: ignoring '-mnan=2008' option because the '%0' architecture does not support it
    • -
    • warning: ignoring '-mnan=legacy' option because the '%0' architecture does not support it
    • +
    • warning: passing %select{an object that undergoes default argument promotion|an object of reference type|a parameter declared with the 'register' keyword}0 to 'va_start' has undefined behavior
    • +
    • warning: second argument to 'va_arg' is of promotable type %0; this va_arg has undefined behavior because arguments will be promoted to %1
    • +
    • warning: second argument to 'va_start' is not the last named parameter

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsupported-target-opt - clang-diagnostic-unsupported-target-opt + clang-diagnostic-variadic-macros + clang-diagnostic-variadic-macros Diagnostic text:

      -
    • warning: debug information option '%0' is not supported for target '%1'
    • -
    • warning: debug information option '%0' is not supported; requires DWARF-%2 but target '%1' only provides DWARF-%3
    • +
    • warning: __VA_OPT__ can only appear in the expansion of a variadic macro
    • +
    • warning: named variadic macros are a GNU extension
    • +
    • warning: variadic macros are a C99 feature

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unused - clang-diagnostic-unused + clang-diagnostic-vector-conversion + clang-diagnostic-vector-conversion - Diagnostic text:

    -
      -
    • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
    • -
    • warning: %select{function|variable}0 %1 is not needed and will not be emitted
    • -
    • warning: 'static' function %0 declared in header file should be declared 'static inline'
    • -
    • warning: container access result unused - container access should not be used for side effects
    • -
    • warning: expression result unused
    • -
    • warning: expression result unused; should this cast be to 'void'?
    • -
    • warning: expression with side effects has no effect in an unevaluated context
    • -
    • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
    • -
    • warning: ignoring return value of function declared with %0 attribute
    • -
    • warning: ignoring return value of function declared with %0 attribute
    • -
    • warning: ignoring return value of function declared with %0 attribute: %1
    • -
    • warning: ignoring temporary created by a constructor declared with %0 attribute
    • -
    • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
    • -
    • warning: ivar %0 which backs the property is not referenced in this property's accessor
    • -
    • warning: lambda capture %0 is not %select{used|required to be captured for this use}1
    • -
    • warning: left operand of comma operator has no effect
    • -
    • warning: private field %0 is not used
    • -
    • warning: unused %select{typedef|type alias}0 %1
    • -
    • warning: unused function %0
    • -
    • warning: unused label %0
    • -
    • warning: unused variable %0
    • -
    • warning: unused variable %0
    • -
    • warning: variable %0 set but not used
    • + Diagnostic text:

      +
        +
      • warning: incompatible vector types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]> INFO - clang-diagnostic-unused-but-set-parameter - clang-diagnostic-unused-but-set-parameter + clang-diagnostic-vexing-parse + clang-diagnostic-vexing-parse Diagnostic text:

        -
      • warning: parameter %0 set but not used
      • +
      • warning: empty parentheses interpreted as a function declaration
      • +
      • warning: parentheses were disambiguated as a function declaration
      • +
      • warning: parentheses were disambiguated as redundant parentheses around declaration of variable named %0

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-but-set-variable - clang-diagnostic-unused-but-set-variable + clang-diagnostic-visibility + clang-diagnostic-visibility Diagnostic text:

        -
      • warning: variable %0 set but not used
      • +
      • warning: declaration of %0 will not be visible outside of this function
      • +
      • warning: redefinition of %0 will not be visible outside of this function

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-command-line-argument - clang-diagnostic-unused-command-line-argument + clang-diagnostic-void-ptr-dereference + clang-diagnostic-void-ptr-dereference Diagnostic text:

        -
      • warning: %0: '%1' input unused in cpp mode
      • -
      • warning: %0: '%1' input unused%select{ when '%3' is present|}2
      • -
      • warning: %0: previously preprocessed input%select{ unused when '%2' is present|}1
      • -
      • warning: argument '%0' requires profile-guided optimization information
      • -
      • warning: argument unused during compilation: '%0'
      • -
      • warning: ignoring -fdiscard-value-names for LLVM Bitcode
      • -
      • warning: ignoring -fverify-debuginfo-preserve-export=%0 because -fverify-debuginfo-preserve wasn't enabled
      • -
      • warning: ignoring invalid /arch: argument '%0'; for %select{64|32}1-bit expected one of %2
      • -
      • warning: joined argument expects additional value: '%0'
      • -
      • warning: the flag '%0' has been deprecated and will be ignored
      • +
      • warning: ISO C does not allow indirection on operand of type %0

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-comparison - clang-diagnostic-unused-comparison + clang-diagnostic-void-pointer-to-enum-cast + clang-diagnostic-void-pointer-to-enum-cast Diagnostic text:

        -
      • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
      • +
      • warning: cast to smaller integer type %1 from %0

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-const-variable - clang-diagnostic-unused-const-variable + clang-diagnostic-void-pointer-to-int-cast + clang-diagnostic-void-pointer-to-int-cast Diagnostic text:

        -
      • warning: unused variable %0
      • +
      • warning: cast to smaller integer type %1 from %0
      • +
      • warning: cast to smaller integer type %1 from %0

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-exception-parameter - clang-diagnostic-unused-exception-parameter + clang-diagnostic-wasm-exception-spec + clang-diagnostic-wasm-exception-spec Diagnostic text:

        -
      • warning: unused exception parameter %0
      • +
      • warning: dynamic exception specifications with types are currently ignored in wasm

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-function - clang-diagnostic-unused-function + clang-diagnostic-writable-strings + clang-diagnostic-writable-strings Diagnostic text:

        -
      • warning: %select{function|variable}0 %1 is not needed and will not be emitted
      • -
      • warning: 'static' function %0 declared in header file should be declared 'static inline'
      • -
      • warning: unused function %0
      • +
      • warning: ISO C++11 does not allow conversion from string literal to %0
      • +
      • warning: conversion from string literal to %0 is deprecated

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-getter-return-value - clang-diagnostic-unused-getter-return-value + clang-diagnostic-xor-used-as-pow + clang-diagnostic-xor-used-as-pow Diagnostic text:

        -
      • warning: property access result unused - getters should not be used for side effects
      • +
      • warning: result of '%0' is %1; did you mean '%2' (%3)?
      • +
      • warning: result of '%0' is %1; did you mean '%2'?
      • +
      • warning: result of '%0' is %1; did you mean exponentiation?

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-label - clang-diagnostic-unused-label + clang-diagnostic-zero-length-array + clang-diagnostic-zero-length-array Diagnostic text:

        -
      • warning: unused label %0
      • +
      • warning: zero size arrays are an extension

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-lambda-capture - clang-diagnostic-unused-lambda-capture + clang-diagnostic-slash-u-filename + clang-diagnostic-slash-u-filename Diagnostic text:

        -
      • warning: lambda capture %0 is not %select{used|required to be captured for this use}1
      • +
      • warning: '/U%0' treated as the '/U' option

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-local-typedef - clang-diagnostic-unused-local-typedef + clang-diagnostic-msvc-not-found + clang-diagnostic-msvc-not-found Diagnostic text:

        -
      • warning: unused %select{typedef|type alias}0 %1
      • +
      • warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-member-function - clang-diagnostic-unused-member-function + clang-diagnostic-darwin-sdk-settings + clang-diagnostic-darwin-sdk-settings Diagnostic text:

        -
      • warning: member function %0 is not needed and will not be emitted
      • -
      • warning: unused member function %0
      • +
      • warning: SDK settings were ignored as 'SDKSettings.json' could not be parsed

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-parameter - clang-diagnostic-unused-parameter + clang-diagnostic-stdlibcxx-not-found + clang-diagnostic-stdlibcxx-not-found Diagnostic text:

        -
      • warning: unused parameter %0
      • +
      • warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-private-field - clang-diagnostic-unused-private-field + clang-diagnostic-sarif-format-unstable + clang-diagnostic-sarif-format-unstable Diagnostic text:

        -
      • warning: private field %0 is not used
      • +
      • warning: diagnostic formatting in SARIF mode is currently unstable

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-property-ivar - clang-diagnostic-unused-property-ivar + clang-diagnostic-missing-multilib + clang-diagnostic-missing-multilib Diagnostic text:

        -
      • warning: ivar %0 which backs the property is not referenced in this property's accessor
      • +
      • warning: no multilib found matching flags: %0

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-result - clang-diagnostic-unused-result + clang-diagnostic-android-unversioned-fallback + clang-diagnostic-android-unversioned-fallback Diagnostic text:

        -
      • warning: ignoring return value of function declared with %0 attribute
      • -
      • warning: ignoring return value of function declared with %0 attribute: %1
      • +
      • warning: Using unversioned Android target directory %0 for target %1. Unversioned directories will not be used in Clang 19. Provide a versioned directory for the target version or lower instead.

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-template - clang-diagnostic-unused-template + clang-diagnostic-override-module + clang-diagnostic-override-module Diagnostic text:

        -
      • warning: %select{function|variable}0 %1 is not needed and will not be emitted
      • -
      • warning: 'static' function %0 declared in header file should be declared 'static inline'
      • -
      • warning: unused %select{function|variable}0 template %1
      • +
      • warning: overriding the module target triple with %0

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-value - clang-diagnostic-unused-value + clang-diagnostic-unable-to-open-stats-file + clang-diagnostic-unable-to-open-stats-file Diagnostic text:

        -
      • warning: %select{equality|inequality|relational|three-way}0 comparison result unused
      • -
      • warning: container access result unused - container access should not be used for side effects
      • -
      • warning: expression result unused
      • -
      • warning: expression result unused; should this cast be to 'void'?
      • -
      • warning: expression with side effects has no effect in an unevaluated context
      • -
      • warning: expression with side effects will be evaluated despite being used as an operand to 'typeid'
      • -
      • warning: ignoring return value of function declared with %0 attribute
      • -
      • warning: ignoring return value of function declared with %0 attribute
      • -
      • warning: ignoring return value of function declared with %0 attribute: %1
      • -
      • warning: ignoring temporary created by a constructor declared with %0 attribute
      • -
      • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
      • -
      • warning: left operand of comma operator has no effect
      • +
      • warning: unable to open statistics output file '%0': '%1'

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-unused-variable - clang-diagnostic-unused-variable + clang-diagnostic-analyzer-incompatible-plugin + clang-diagnostic-analyzer-incompatible-plugin Diagnostic text:

        -
      • warning: unused variable %0
      • -
      • warning: unused variable %0
      • +
      • warning: checker plugin '%0' is not compatible with this version of the analyzer

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-used-but-marked-unused - clang-diagnostic-used-but-marked-unused + clang-diagnostic-div-by-zero + clang-diagnostic-div-by-zero Diagnostic text:

        -
      • warning: %0 was marked unused but was used
      • +
      • warning: %select{remainder|division}0 by zero is undefined

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-search-path-usage - clang-diagnostic-search-path-usage + clang-diagnostic-module-file-config-mismatch + clang-diagnostic-module-file-config-mismatch Diagnostic text:

        -
      • remark: search path used: '%0'
      • +
      • warning: module file %0 cannot be loaded due to a configuration mismatch with the current compilation

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      - INFO + CRITICAL
      - clang-diagnostic-user-defined-literals - clang-diagnostic-user-defined-literals + clang-diagnostic-eager-load-cxx-named-modules + clang-diagnostic-eager-load-cxx-named-modules Diagnostic text:

        -
      • warning: user-defined literal suffixes not starting with '_' are reserved%select{; no literal will invoke this operator|}0
      • +
      • warning: the form '-fmodule-file=<BMI-path>' is deprecated for standard C++ named modules;consider to use '-fmodule-file=<module-name>=<BMI-path>' instead

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-user-defined-warnings - clang-diagnostic-user-defined-warnings + clang-diagnostic-psabi + clang-diagnostic-psabi Diagnostic text:

        -
      • warning: %0
      • +
      • warning: AVX vector %select{return|argument}0 of type %1 without '%2' enabled changes the ABI

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-vla - clang-diagnostic-vla + clang-diagnostic-backslash-newline-escape + clang-diagnostic-backslash-newline-escape Diagnostic text:

        -
      • warning: variable length array used
      • -
      • warning: variable length arrays are a C99 feature
      • +
      • warning: backslash and newline separated by space

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-vla-extension - clang-diagnostic-vla-extension + clang-diagnostic-dollar-in-identifier-extension + clang-diagnostic-dollar-in-identifier-extension Diagnostic text:

        -
      • warning: variable length arrays are a C99 feature
      • +
      • warning: '$' in identifier

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-varargs - clang-diagnostic-varargs + clang-diagnostic-language-extension-token + clang-diagnostic-language-extension-token Diagnostic text:

        -
      • warning: passing %select{an object that undergoes default argument promotion|an object of reference type|a parameter declared with the 'register' keyword}0 to 'va_start' has undefined behavior
      • -
      • warning: second argument to 'va_arg' is of promotable type %0; this va_arg has undefined behavior because arguments will be promoted to %1
      • -
      • warning: second argument to 'va_start' is not the last named parameter
      • +
      • warning: extension used

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-variadic-macros - clang-diagnostic-variadic-macros + clang-diagnostic-invalid-utf8 + clang-diagnostic-invalid-utf8 Diagnostic text:

        -
      • warning: __VA_OPT__ can only appear in the expansion of a variadic macro
      • -
      • warning: named variadic macros are a GNU extension
      • -
      • warning: variadic macros are a C99 feature
      • +
      • warning: invalid UTF-8 in comment

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-vector-conversion - clang-diagnostic-vector-conversion + clang-diagnostic-unicode-whitespace + clang-diagnostic-unicode-whitespace Diagnostic text:

        -
      • warning: incompatible vector types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2
      • +
      • warning: treating Unicode character as whitespace

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-vexing-parse - clang-diagnostic-vexing-parse + clang-diagnostic-unicode-homoglyph + clang-diagnostic-unicode-homoglyph Diagnostic text:

        -
      • warning: empty parentheses interpreted as a function declaration
      • -
      • warning: parentheses were disambiguated as a function declaration
      • -
      • warning: parentheses were disambiguated as redundant parentheses around declaration of variable named %0
      • +
      • warning: treating Unicode character <U+%0> as an identifier character rather than as '%1' symbol

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-visibility - clang-diagnostic-visibility + clang-diagnostic-unicode-zero-width + clang-diagnostic-unicode-zero-width Diagnostic text:

        -
      • warning: declaration of %0 will not be visible outside of this function
      • -
      • warning: redefinition of %0 will not be visible outside of this function
      • +
      • warning: identifier contains Unicode character <U+%0> that is invisible in some environments

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-void-pointer-to-enum-cast - clang-diagnostic-void-pointer-to-enum-cast + clang-diagnostic-c++1z-compat-mangling + clang-diagnostic-c++1z-compat-mangling Diagnostic text:

        -
      • warning: cast to smaller integer type %1 from %0
      • +
      • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-void-pointer-to-int-cast - clang-diagnostic-void-pointer-to-int-cast + clang-diagnostic-mathematical-notation-identifier-extension + clang-diagnostic-mathematical-notation-identifier-extension Diagnostic text:

        -
      • warning: cast to smaller integer type %1 from %0
      • -
      • warning: cast to smaller integer type %1 from %0
      • +
      • warning: mathematical notation character <U+%0> in an identifier is a Clang extension

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-wasm-exception-spec - clang-diagnostic-wasm-exception-spec + clang-diagnostic-delimited-escape-sequence-extension + clang-diagnostic-delimited-escape-sequence-extension Diagnostic text:

        -
      • warning: dynamic exception specifications with types are currently ignored in wasm
      • +
      • warning: %select{delimited|named}0 escape sequences are a %select{Clang|C++23}1 extension

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-writable-strings - clang-diagnostic-writable-strings + clang-diagnostic-unknown-escape-sequence + clang-diagnostic-unknown-escape-sequence Diagnostic text:

        -
      • warning: ISO C++11 does not allow conversion from string literal to %0
      • -
      • warning: conversion from string literal to %0 is deprecated
      • +
      • warning: unknown escape sequence '\%0'

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-xor-used-as-pow - clang-diagnostic-xor-used-as-pow + clang-diagnostic-invalid-unevaluated-string + clang-diagnostic-invalid-unevaluated-string Diagnostic text:

        -
      • warning: result of '%0' is %1; did you mean '%2' (%3)?
      • -
      • warning: result of '%0' is %1; did you mean '%2'?
      • -
      • warning: result of '%0' is %1; did you mean exponentiation?
      • +
      • warning: encoding prefix '%0' on an unevaluated string literal has no effect%select{| and is incompatible with c++2c}1

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-zero-length-array - clang-diagnostic-zero-length-array + clang-diagnostic-include-next-outside-header + clang-diagnostic-include-next-outside-header Diagnostic text:

        -
      • warning: zero size arrays are an extension
      • +
      • warning: #include_next in primary source file; will search from start of include path

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-c++98-c++11-compat - clang-diagnostic-c++98-c++11-compat + clang-diagnostic-include-next-absolute-path + clang-diagnostic-include-next-absolute-path Diagnostic text:

        -
      • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
      • -
      • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
      • -
      • warning: digit separators are incompatible with C++ standards before C++14
      • -
      • warning: generic lambdas are incompatible with C++11
      • -
      • warning: initialized lambda captures are incompatible with C++ standards before C++14
      • -
      • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
      • -
      • warning: return type deduction is incompatible with C++ standards before C++14
      • -
      • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • -
      • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • -
      • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • -
      • warning: variable templates are incompatible with C++ standards before C++14
      • +
      • warning: #include_next in file found relative to primary source file or found by absolute path; will search from start of include path

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      @@ -27543,6 +31557,31 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-pre-c2x-compat + clang-diagnostic-pre-c2x-compat + + Diagnostic text:

      +
        +
      • warning: #warning is incompatible with C standards before C23
      • +
      • warning: '%0' is incompatible with C standards before C23
      • +
      • warning: '...' as the only parameter of a function is incompatible with C standards before C23
      • +
      • warning: '_BitInt' suffix for literals is incompatible with C standards before C23
      • +
      • warning: '_Static_assert' with no message is incompatible with C standards before C23
      • +
      • warning: [[]] attributes are incompatible with C standards before C23
      • +
      • warning: digit separators are incompatible with C standards before C23
      • +
      • warning: label at end of compound statement is incompatible with C standards before C23
      • +
      • warning: label followed by a declaration is incompatible with C standards before C23
      • +
      • warning: specifying character '%0' with a universal character name is incompatible with C standards before C23
      • +
      • warning: universal character name referring to a control character is incompatible with C standards before C23
      • +
      • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C standards before C23
      • +
      • warning: use of an empty initializer is incompatible with C standards before C23
      • +
      +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      clang-diagnostic-disabled-macro-expansion clang-diagnostic-disabled-macro-expansion @@ -27622,39 +31661,28 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-c++98-c++11-compat-pedantic - clang-diagnostic-c++98-c++11-compat-pedantic + clang-diagnostic-embedded-directive + clang-diagnostic-embedded-directive Diagnostic text:

        -
      • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
      • -
      • warning: binary integer literals are incompatible with C++ standards before C++14
      • -
      • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
      • -
      • warning: digit separators are incompatible with C++ standards before C++14
      • -
      • warning: generic lambdas are incompatible with C++11
      • -
      • warning: initialized lambda captures are incompatible with C++ standards before C++14
      • -
      • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
      • -
      • warning: return type deduction is incompatible with C++ standards before C++14
      • -
      • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • -
      • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • -
      • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • -
      • warning: variable templates are incompatible with C++ standards before C++14
      • +
      • warning: embedding a directive within macro arguments has undefined behavior

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-embedded-directive - clang-diagnostic-embedded-directive + clang-diagnostic-unknown-directives + clang-diagnostic-unknown-directives Diagnostic text:

        -
      • warning: embedding a directive within macro arguments has undefined behavior
      • +
      • warning: invalid preprocessing directive%select{|, did you mean '#%1'?}0

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      @@ -27684,6 +31712,31 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-pre-c2x-compat-pedantic + clang-diagnostic-pre-c2x-compat-pedantic + + Diagnostic text:

      +
        +
      • warning: #warning is incompatible with C standards before C23
      • +
      • warning: '%0' is incompatible with C standards before C23
      • +
      • warning: '...' as the only parameter of a function is incompatible with C standards before C23
      • +
      • warning: '_BitInt' suffix for literals is incompatible with C standards before C23
      • +
      • warning: '_Static_assert' with no message is incompatible with C standards before C23
      • +
      • warning: [[]] attributes are incompatible with C standards before C23
      • +
      • warning: digit separators are incompatible with C standards before C23
      • +
      • warning: label at end of compound statement is incompatible with C standards before C23
      • +
      • warning: label followed by a declaration is incompatible with C standards before C23
      • +
      • warning: specifying character '%0' with a universal character name is incompatible with C standards before C23
      • +
      • warning: universal character name referring to a control character is incompatible with C standards before C23
      • +
      • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C standards before C23
      • +
      • warning: use of an empty initializer is incompatible with C standards before C23
      • +
      +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      clang-diagnostic-private-header clang-diagnostic-private-header @@ -27697,6 +31750,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve CRITICAL + + clang-diagnostic-include-angled-in-module-purview + clang-diagnostic-include-angled-in-module-purview + + Diagnostic text:

      +
        +
      • warning: '#include <filename>' attaches the declarations to the named module '%0', which is not usually intended; consider moving that directive before the module declaration
      • +
      +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      clang-diagnostic-header-guard clang-diagnostic-header-guard @@ -27789,44 +31855,51 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-missing-selector-name - clang-diagnostic-missing-selector-name + clang-diagnostic-generic-type-extension + clang-diagnostic-generic-type-extension Diagnostic text:

        -
      • warning: %0 used as the name of the previous parameter rather than as part of the selector
      • +
      • warning: passing a type argument as the first operand to '_Generic' is a Clang extension

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-c++98-c++11-c++14-compat - clang-diagnostic-c++98-c++11-c++14-compat + clang-diagnostic-c++98-c++11-compat + clang-diagnostic-c++98-c++11-compat Diagnostic text:

        -
      • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
      • -
      • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
      • -
      • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
      • -
      • warning: by value capture of '*this' is incompatible with C++ standards before C++17
      • -
      • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
      • -
      • warning: constexpr if is incompatible with C++ standards before C++17
      • -
      • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
      • -
      • warning: decomposition declarations are incompatible with C++ standards before C++17
      • -
      • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
      • -
      • warning: inline variables are incompatible with C++ standards before C++17
      • -
      • warning: nested namespace definition is incompatible with C++ standards before C++17
      • -
      • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
      • -
      • warning: pack expansion using declaration is incompatible with C++ standards before C++17
      • -
      • warning: pack fold expression is incompatible with C++ standards before C++17
      • -
      • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
      • -
      • warning: unicode literals are incompatible with C++ standards before C++17
      • -
      • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
      • +
      • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
      • +
      • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
      • +
      • warning: digit separators are incompatible with C++ standards before C++14
      • +
      • warning: generic lambdas are incompatible with C++11
      • +
      • warning: initialized lambda captures are incompatible with C++ standards before C++14
      • +
      • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
      • +
      • warning: return type deduction is incompatible with C++ standards before C++14
      • +
      • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • +
      • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • +
      • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • +
      • warning: variable templates are incompatible with C++ standards before C++14

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      + + clang-diagnostic-missing-selector-name + clang-diagnostic-missing-selector-name + + Diagnostic text:

      +
        +
      • warning: %0 used as the name of the previous parameter rather than as part of the selector
      • +
      +

      References

      +

      Diagnostic flags in Clang

      ]]>
      INFO
      @@ -27901,7 +31974,7 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve Diagnostic text:

        -
      • warning: ISO C++ does not allow an attribute list to appear here
      • +
      • warning: ISO C++ does not allow %select{an attribute list|%0}1 to appear here

      References

      Diagnostic flags in Clang

      ]]> @@ -27948,59 +32021,52 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-c++98-c++11-c++14-compat-pedantic - clang-diagnostic-c++98-c++11-c++14-compat-pedantic + clang-diagnostic-concepts-ts-compat + clang-diagnostic-concepts-ts-compat Diagnostic text:

        -
      • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
      • -
      • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
      • -
      • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
      • -
      • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
      • -
      • warning: by value capture of '*this' is incompatible with C++ standards before C++17
      • -
      • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
      • -
      • warning: constexpr if is incompatible with C++ standards before C++17
      • -
      • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
      • -
      • warning: decomposition declarations are incompatible with C++ standards before C++17
      • -
      • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
      • -
      • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
      • -
      • warning: inline variables are incompatible with C++ standards before C++17
      • -
      • warning: nested namespace definition is incompatible with C++ standards before C++17
      • -
      • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
      • -
      • warning: pack expansion using declaration is incompatible with C++ standards before C++17
      • -
      • warning: pack fold expression is incompatible with C++ standards before C++17
      • -
      • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
      • -
      • warning: unicode literals are incompatible with C++ standards before C++17
      • -
      • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
      • +
      • warning: ISO C++20 does not permit the 'bool' keyword after 'concept'

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-concepts-ts-compat - clang-diagnostic-concepts-ts-compat + clang-diagnostic-duplicate-enum + clang-diagnostic-duplicate-enum Diagnostic text:

        -
      • warning: ISO C++20 does not permit the 'bool' keyword after 'concept'
      • +
      • warning: element %0 has been implicitly assigned %1 which another element has been assigned

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-duplicate-enum - clang-diagnostic-duplicate-enum + clang-diagnostic-c++98-c++11-compat-pedantic + clang-diagnostic-c++98-c++11-compat-pedantic Diagnostic text:

        -
      • warning: element %0 has been implicitly assigned %1 which another element has been assigned
      • +
      • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
      • +
      • warning: binary integer literals are incompatible with C++ standards before C++14
      • +
      • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
      • +
      • warning: digit separators are incompatible with C++ standards before C++14
      • +
      • warning: generic lambdas are incompatible with C++11
      • +
      • warning: initialized lambda captures are incompatible with C++ standards before C++14
      • +
      • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
      • +
      • warning: return type deduction is incompatible with C++ standards before C++14
      • +
      • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • +
      • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • +
      • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
      • +
      • warning: variable templates are incompatible with C++ standards before C++14

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      @@ -28018,28 +32084,54 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-predefined-identifier-outside-function - clang-diagnostic-predefined-identifier-outside-function + clang-diagnostic-predefined-identifier-outside-function + clang-diagnostic-predefined-identifier-outside-function + + Diagnostic text:

      +
        +
      • warning: predefined identifier is only valid inside function
      • +
      +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      + + clang-diagnostic-interrupt-service-routine + clang-diagnostic-interrupt-service-routine + + Diagnostic text:

      +
        +
      • warning: interrupt service routine should only call a function with attribute 'no_caller_saved_registers'
      • +
      +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + INFO +
      + + clang-diagnostic-auto-decl-extensions + clang-diagnostic-auto-decl-extensions Diagnostic text:

        -
      • warning: predefined identifier is only valid inside function
      • +
      • warning: type inference of a declaration other than a plain identifier with optional trailing attributes is a Clang extension

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-interrupt-service-routine - clang-diagnostic-interrupt-service-routine + clang-diagnostic-excessive-regsave + clang-diagnostic-excessive-regsave Diagnostic text:

        -
      • warning: interrupt service routine should only call a function with attribute 'no_caller_saved_registers'
      • +
      • warning: %select{interrupt service routine|function with attribute 'no_caller_saved_registers'}0 should only call a function with attribute 'no_caller_saved_registers' or be compiled with '-mgeneral-regs-only'

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      @@ -28109,53 +32201,44 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-c++98-c++11-c++14-c++17-compat - clang-diagnostic-c++98-c++11-c++14-c++17-compat + clang-diagnostic-strlcpy-strlcat-size + clang-diagnostic-strlcpy-strlcat-size Diagnostic text:

        -
      • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
      • -
      • warning: '<=>' operator is incompatible with C++ standards before C++20
      • -
      • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
      • -
      • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
      • -
      • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
      • -
      • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
      • -
      • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
      • -
      • warning: defaulted comparison operators are incompatible with C++ standards before C++20
      • -
      • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
      • -
      • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
      • -
      • warning: explicit(bool) is incompatible with C++ standards before C++20
      • -
      • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
      • -
      • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • -
      • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
      • -
      • warning: inline nested namespace definition is incompatible with C++ standards before C++20
      • -
      • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
      • -
      • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
      • -
      • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
      • -
      • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
      • -
      • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
      • -
      • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • -
      • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
      • -
      • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • -
      • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
      • -
      • warning: using enum declaration is incompatible with C++ standards before C++20
      • -
      • warning: virtual constexpr functions are incompatible with C++ standards before C++20
      • +
      • warning: size argument in %0 call appears to be size of the source; expected the size of the destination

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-strlcpy-strlcat-size - clang-diagnostic-strlcpy-strlcat-size + clang-diagnostic-c++98-c++11-c++14-compat + clang-diagnostic-c++98-c++11-c++14-compat Diagnostic text:

        -
      • warning: size argument in %0 call appears to be size of the source; expected the size of the destination
      • +
      • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
      • +
      • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
      • +
      • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
      • +
      • warning: by value capture of '*this' is incompatible with C++ standards before C++17
      • +
      • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
      • +
      • warning: constexpr if is incompatible with C++ standards before C++17
      • +
      • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
      • +
      • warning: decomposition declarations are incompatible with C++ standards before C++17
      • +
      • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
      • +
      • warning: inline variables are incompatible with C++ standards before C++17
      • +
      • warning: nested namespace definition is incompatible with C++ standards before C++17
      • +
      • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
      • +
      • warning: pack expansion using declaration is incompatible with C++ standards before C++17
      • +
      • warning: pack fold expression is incompatible with C++ standards before C++17
      • +
      • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
      • +
      • warning: unicode literals are incompatible with C++ standards before C++17
      • +
      • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      @@ -28277,55 +32360,46 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-c++98-c++11-c++14-c++17-compat-pedantic - clang-diagnostic-c++98-c++11-c++14-c++17-compat-pedantic + clang-diagnostic-atomic-property-with-user-defined-accessor + clang-diagnostic-atomic-property-with-user-defined-accessor Diagnostic text:

        -
      • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
      • -
      • warning: '<=>' operator is incompatible with C++ standards before C++20
      • -
      • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
      • -
      • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
      • -
      • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
      • -
      • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
      • -
      • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
      • -
      • warning: defaulted comparison operators are incompatible with C++ standards before C++20
      • -
      • warning: designated initializers are incompatible with C++ standards before C++20
      • -
      • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
      • -
      • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
      • -
      • warning: explicit(bool) is incompatible with C++ standards before C++20
      • -
      • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
      • -
      • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • -
      • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
      • -
      • warning: inline nested namespace definition is incompatible with C++ standards before C++20
      • -
      • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
      • -
      • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
      • -
      • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
      • -
      • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
      • -
      • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
      • -
      • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
      • -
      • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • -
      • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
      • -
      • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • -
      • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
      • -
      • warning: using enum declaration is incompatible with C++ standards before C++20
      • -
      • warning: virtual constexpr functions are incompatible with C++ standards before C++20
      • +
      • warning: writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 with a user defined %select{getter|setter}2

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      - clang-diagnostic-atomic-property-with-user-defined-accessor - clang-diagnostic-atomic-property-with-user-defined-accessor + clang-diagnostic-c++98-c++11-c++14-compat-pedantic + clang-diagnostic-c++98-c++11-c++14-compat-pedantic Diagnostic text:

        -
      • warning: writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 with a user defined %select{getter|setter}2
      • +
      • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
      • +
      • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
      • +
      • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
      • +
      • warning: attributes on %select{a namespace|an enumerator}0 declaration are incompatible with C++ standards before C++17
      • +
      • warning: by value capture of '*this' is incompatible with C++ standards before C++17
      • +
      • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
      • +
      • warning: constexpr if is incompatible with C++ standards before C++17
      • +
      • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
      • +
      • warning: decomposition declarations are incompatible with C++ standards before C++17
      • +
      • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
      • +
      • warning: hexadecimal floating literals are incompatible with C++ standards before C++17
      • +
      • warning: inline variables are incompatible with C++ standards before C++17
      • +
      • warning: nested namespace definition is incompatible with C++ standards before C++17
      • +
      • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
      • +
      • warning: pack expansion using declaration is incompatible with C++ standards before C++17
      • +
      • warning: pack fold expression is incompatible with C++ standards before C++17
      • +
      • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
      • +
      • warning: unicode literals are incompatible with C++ standards before C++17
      • +
      • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      INFO
      @@ -28433,6 +32507,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
      INFO + + clang-diagnostic-invalid-static-assert-message + clang-diagnostic-invalid-static-assert-message + + Diagnostic text:

      +
        +
      • warning: the message in this static assertion is not a constant expression
      • +
      +

      References

      +

      Diagnostic flags in Clang

      ]]> +
      + CRITICAL +
      clang-diagnostic-redundant-consteval-if clang-diagnostic-redundant-consteval-if @@ -28447,23 +32534,43 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-c++0x-narrowing - clang-diagnostic-c++0x-narrowing + clang-diagnostic-c++98-c++11-c++14-c++17-compat + clang-diagnostic-c++98-c++11-c++14-c++17-compat Diagnostic text:

        -
      • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
      • -
      • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
      • -
      • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
      • -
      • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
      • -
      • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
      • -
      • warning: type %0 cannot be narrowed to %1 in initializer list
      • -
      • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
      • +
      • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
      • +
      • warning: '<=>' operator is incompatible with C++ standards before C++20
      • +
      • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
      • +
      • warning: captured structured bindings are incompatible with C++ standards before C++20
      • +
      • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
      • +
      • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
      • +
      • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
      • +
      • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
      • +
      • warning: defaulted comparison operators are incompatible with C++ standards before C++20
      • +
      • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
      • +
      • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
      • +
      • warning: explicit(bool) is incompatible with C++ standards before C++20
      • +
      • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
      • +
      • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • +
      • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
      • +
      • warning: inline nested namespace definition is incompatible with C++ standards before C++20
      • +
      • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
      • +
      • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
      • +
      • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
      • +
      • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
      • +
      • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
      • +
      • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • +
      • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
      • +
      • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
      • +
      • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
      • +
      • warning: using enum declaration is incompatible with C++ standards before C++20
      • +
      • warning: virtual constexpr functions are incompatible with C++ standards before C++20

      References

      -

      Diagnostic flags in Clang

      ]]> +

      Diagnostic flags in Clang

      ]]>
      - CRITICAL + INFO
      clang-diagnostic-weak-vtables @@ -28539,33 +32646,113 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
    • warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-invalid-constexpr + clang-diagnostic-invalid-constexpr + + Diagnostic text:

    +
      +
    • warning: %select{constexpr|consteval}1 %select{function|constructor}0 never produces a constant expression
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + CRITICAL +
    + + clang-diagnostic-auto-var-id + clang-diagnostic-auto-var-id + + Diagnostic text:

    +
      +
    • warning: 'auto' deduced as 'id' in declaration of %0
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-undefined-arm-streaming + clang-diagnostic-undefined-arm-streaming + + Diagnostic text:

    +
      +
    • warning: builtin call has undefined behaviour when called from a %0 function
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-undefined-arm-za + clang-diagnostic-undefined-arm-za + + Diagnostic text:

    +
      +
    • warning: builtin call is not valid when calling from a function without active ZA state
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-c++98-c++11-c++14-c++17-compat-pedantic + clang-diagnostic-c++98-c++11-c++14-c++17-compat-pedantic + + Diagnostic text:

    +
      +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: designated initializers are incompatible with C++ standards before C++20
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-invalid-constexpr - clang-diagnostic-invalid-constexpr - - Diagnostic text:

    -
      -
    • warning: %select{constexpr|consteval}1 %select{function|constructor}0 never produces a constant expression
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - CRITICAL -
    - - clang-diagnostic-auto-var-id - clang-diagnostic-auto-var-id + clang-diagnostic-undefined-arm-zt0 + clang-diagnostic-undefined-arm-zt0 Diagnostic text:

      -
    • warning: 'auto' deduced as 'id' in declaration of %0
    • +
    • warning: builtin call is not valid when calling from a function without active ZT0 state

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    @@ -28595,25 +32782,6 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
    INFO
    - - clang-diagnostic-narrowing - clang-diagnostic-narrowing - - Diagnostic text:

    -
      -
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - CRITICAL -
    clang-diagnostic-alloca clang-diagnostic-alloca @@ -28705,6 +32873,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-pre-c++2c-compat + clang-diagnostic-pre-c++2c-compat + + Diagnostic text:

    +
      +
    • warning: placeholder variables are incompatible with C++ standards before C++2c
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-invalid-initializer-from-system-header clang-diagnostic-invalid-initializer-from-system-header @@ -28758,118 +32939,28 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-unsupported-availability-guard - clang-diagnostic-unsupported-availability-guard + clang-diagnostic-missing-prototype-for-cc + clang-diagnostic-missing-prototype-for-cc Diagnostic text:

      -
    • warning: %select{@available|__builtin_available}0 does not guard availability here; use if (%select{@available|__builtin_available}0) instead
    • +
    • warning: function with no prototype cannot use the %0 calling convention

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++0x-compat - clang-diagnostic-c++0x-compat - - Diagnostic text:

    -
      -
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • -
    • warning: '%0' is a keyword in C++11
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'auto' storage class specifier is redundant and incompatible with C++11
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • -
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • -
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • -
    • warning: constexpr if is incompatible with C++ standards before C++17
    • -
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: conversion from string literal to %0 is deprecated
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: digit separators are incompatible with C++ standards before C++14
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit instantiation cannot be 'inline'
    • -
    • warning: explicit instantiation of %0 must occur at global scope
    • -
    • warning: explicit instantiation of %0 not in a namespace enclosing %1
    • -
    • warning: explicit instantiation of %q0 must occur in namespace %1
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: generic lambdas are incompatible with C++11
    • -
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    • -
    • warning: identifier after literal will be treated as a user-defined literal suffix in C++11
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: inline variables are incompatible with C++ standards before C++17
    • -
    • warning: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • -
    • warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C++98; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • -
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • -
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • -
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: return type deduction is incompatible with C++ standards before C++14
    • -
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • -
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: unicode literals are incompatible with C++ standards before C++17
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • -
    • warning: use of right-shift operator ('>>') in template argument will require parentheses in C++11
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • -
    • warning: variable templates are incompatible with C++ standards before C++14
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - CRITICAL -
    - - clang-diagnostic-missing-prototype-for-cc - clang-diagnostic-missing-prototype-for-cc + clang-diagnostic-unsupported-availability-guard + clang-diagnostic-unsupported-availability-guard Diagnostic text:

      -
    • warning: function with no prototype cannot use the %0 calling convention
    • +
    • warning: %select{@available|__builtin_available}0 does not guard availability here; use if (%select{@available|__builtin_available}0) instead

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    @@ -28925,6 +33016,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-pre-c++2c-compat-pedantic + clang-diagnostic-pre-c++2c-compat-pedantic + + Diagnostic text:

    +
      +
    • warning: placeholder variables are incompatible with C++ standards before C++2c
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-attribute-packed-for-bitfield clang-diagnostic-attribute-packed-for-bitfield @@ -28964,65 +33068,6 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - - clang-diagnostic-c++1z-compat - clang-diagnostic-c++1z-compat - - Diagnostic text:

    -
      -
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • -
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • -
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • -
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • -
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • -
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • -
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • -
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • -
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • -
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • -
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • -
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • -
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • -
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • -
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • -
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • -
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • -
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • -
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-unqualified-std-cast-call - clang-diagnostic-unqualified-std-cast-call - - Diagnostic text:

    -
      -
    • warning: unqualified call to %0
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    clang-diagnostic-requires-super-attribute clang-diagnostic-requires-super-attribute @@ -29062,6 +33107,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-unqualified-std-cast-call + clang-diagnostic-unqualified-std-cast-call + + Diagnostic text:

    +
      +
    • warning: unqualified call to '%0'
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-invalid-partial-specialization clang-diagnostic-invalid-partial-specialization @@ -29097,9 +33155,31 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: explicit instantiation of %0 that occurs after an explicit specialization has no effect
  • References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]> + + INFO +
    + + clang-diagnostic-c++0x-narrowing + clang-diagnostic-c++0x-narrowing + + Diagnostic text:

    +
      +
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    clang-diagnostic-typename-missing @@ -29127,43 +33207,6 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - - clang-diagnostic-strict-prototypes - clang-diagnostic-strict-prototypes - - Diagnostic text:

    -
      -
    • warning: this %select{function declaration is not|block declaration is not|old-style function definition is not preceded by}0 a prototype
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-c++2a-compat - clang-diagnostic-c++2a-compat - - Diagnostic text:

    -
      -
    • warning: '%0' is a keyword in C++20
    • -
    • warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior
    • -
    • warning: 'consteval' specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'constinit' specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: aggregate initialization of type %0 with user-declared constructors is incompatible with C++20
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: this expression will be parsed as explicit(bool) in C++20
    • -
    • warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    clang-diagnostic-missing-variable-declarations clang-diagnostic-missing-variable-declarations @@ -29269,57 +33312,50 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-extern-initializer - clang-diagnostic-extern-initializer + clang-diagnostic-narrowing + clang-diagnostic-narrowing Diagnostic text:

      -
    • warning: 'extern' variable has an initializer
    • +
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-braced-scalar-init - clang-diagnostic-braced-scalar-init + clang-diagnostic-extern-initializer + clang-diagnostic-extern-initializer Diagnostic text:

      -
    • warning: braces around %select{scalar |}0initializer
    • +
    • warning: 'extern' variable has an initializer

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++2a-compat-pedantic - clang-diagnostic-c++2a-compat-pedantic + clang-diagnostic-braced-scalar-init + clang-diagnostic-braced-scalar-init Diagnostic text:

      -
    • warning: '%0' is a keyword in C++20
    • -
    • warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior
    • -
    • warning: 'consteval' specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'constinit' specifier is incompatible with C++ standards before C++20
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++2b
    • -
    • warning: aggregate initialization of type %0 with user-declared constructors is incompatible with C++20
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: alias declaration in this context is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: an attribute specifier sequence in this position is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: consteval if is incompatible with C++ standards before C++2b
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension
    • -
    • warning: this expression will be parsed as explicit(bool) in C++20
    • -
    • warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20
    • +
    • warning: braces around %select{scalar |}0initializer

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    @@ -29375,6 +33411,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-atomic-access + clang-diagnostic-atomic-access + + Diagnostic text:

    +
      +
    • warning: accessing a member of an atomic structure or union is undefined behavior
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + CRITICAL +
    clang-diagnostic-float-equal clang-diagnostic-float-equal @@ -29414,6 +33463,110 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-c++0x-compat + clang-diagnostic-c++0x-compat + + Diagnostic text:

    +
      +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{case value|enumerator value|non-type template argument|array size|explicit specifier argument|noexcept specifier argument}0 %select{cannot be narrowed from type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{if|switch}0 initialization statements are incompatible with C++ standards before C++17
    • +
    • warning: '%0' is a keyword in C++11
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' storage class specifier is redundant and incompatible with C++11
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is incompatible with C++ standards before C++17
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'decltype(auto)' type specifier is incompatible with C++ standards before C++14
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'static_assert' with no message is incompatible with C++ standards before C++17
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: by value capture of '*this' is incompatible with C++ standards before C++17
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: class template argument deduction is incompatible with C++ standards before C++17%select{|; for compatibility, use explicit type name %1}0
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1
    • +
    • warning: constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr function with no return statements is incompatible with C++ standards before C++14
    • +
    • warning: constexpr if is incompatible with C++ standards before C++17
    • +
    • warning: constexpr on lambda expressions is incompatible with C++ standards before C++17
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: conversion from string literal to %0 is deprecated
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: decomposition declarations are incompatible with C++ standards before C++17
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: default scope specifier for attributes is incompatible with C++ standards before C++17
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: digit separators are incompatible with C++ standards before C++14
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit instantiation cannot be 'inline'
    • +
    • warning: explicit instantiation of %0 must occur at global scope
    • +
    • warning: explicit instantiation of %0 not in a namespace enclosing %1
    • +
    • warning: explicit instantiation of %q0 must occur in namespace %1
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: generic lambdas are incompatible with C++11
    • +
    • warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11
    • +
    • warning: identifier after literal will be treated as a user-defined literal suffix in C++11
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: initialized lambda captures are incompatible with C++ standards before C++14
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: inline variables are incompatible with C++ standards before C++17
    • +
    • warning: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • +
    • warning: integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C++98; this literal will %select{have type 'long long'|be ill-formed}0 in C++11 onwards
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: multiple return statements in constexpr function is incompatible with C++ standards before C++14
    • +
    • warning: nested namespace definition is incompatible with C++ standards before C++17
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list
    • +
    • warning: non-constant-expression cannot be narrowed from type %0 to %1 in initializer list in C++11
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameters declared with %0 are incompatible with C++ standards before C++17
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: pack expansion using declaration is incompatible with C++ standards before C++17
    • +
    • warning: pack fold expression is incompatible with C++ standards before C++17
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: return type deduction is incompatible with C++ standards before C++14
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: template template parameter using 'typename' is incompatible with C++ standards before C++17
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list
    • +
    • warning: type %0 cannot be narrowed to %1 in initializer list in C++11
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: unicode literals are incompatible with C++ standards before C++17
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17
    • +
    • warning: use of right-shift operator ('>>') in template argument will require parentheses in C++11
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++14
    • +
    • warning: variable templates are incompatible with C++ standards before C++14
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + CRITICAL +
    clang-diagnostic-shift-count-overflow clang-diagnostic-shift-count-overflow @@ -29505,19 +33658,6 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve CRITICAL - - clang-diagnostic-void-ptr-dereference - clang-diagnostic-void-ptr-dereference - - Diagnostic text:

    -
      -
    • warning: ISO C++ does not allow indirection on operand of type %0
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    clang-diagnostic-address-of-packed-member clang-diagnostic-address-of-packed-member @@ -29557,6 +33697,63 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-c++1z-compat + clang-diagnostic-c++1z-compat + + Diagnostic text:

    +
      +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{default construction|assignment}0 of lambda is incompatible with C++ standards before C++20
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: '<=>' operator is incompatible with C++ standards before C++20
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'char8_t' type specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'register' storage class specifier is deprecated and incompatible with C++17
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: captured structured bindings are incompatible with C++ standards before C++20
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: constexpr constructor that does not initialize all members is incompatible with C++ standards before C++20
    • +
    • warning: constexpr union constructor that does not initialize any member is incompatible with C++ standards before C++20
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is incompatible with C++ standards before C++20
    • +
    • warning: default member initializer for bit-field is incompatible with C++ standards before C++20
    • +
    • warning: defaulted comparison operators are incompatible with C++ standards before C++20
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20
    • +
    • warning: explicit template parameter list for lambdas is incompatible with C++ standards before C++20
    • +
    • warning: explicit(bool) is incompatible with C++ standards before C++20
    • +
    • warning: explicitly defaulting this %sub{select_special_member_kind}0 with a type different from the implicit type is incompatible with C++ standards before C++20
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: incrementing expression of type bool is deprecated and incompatible with C++17
    • +
    • warning: initialized lambda capture packs are incompatible with C++ standards before C++20
    • +
    • warning: inline nested namespace definition is incompatible with C++ standards before C++20
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • +
    • warning: member using declaration naming a non-member enumerator is incompatible with C++ standards before C++20
    • +
    • warning: member using declaration naming non-class '%0' enumerator is incompatible with C++ standards before C++20
    • +
    • warning: non-type template parameter of type %0 is incompatible with C++ standards before C++20
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
    • +
    • warning: range-based for loop initialization statements are incompatible with C++ standards before C++20
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of function template name with no prior function template declaration in function call with explicit template arguments is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: using declaration naming a scoped enumerator is incompatible with C++ standards before C++20
    • +
    • warning: using enum declaration is incompatible with C++ standards before C++20
    • +
    • warning: virtual constexpr functions are incompatible with C++ standards before C++20
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-objc-circular-container clang-diagnostic-objc-circular-container @@ -29615,23 +33812,36 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve Diagnostic text:

      -
    • warning: multiple suitable %0 functions for %1; no 'operator delete' function will be invoked if initialization throws an exception
    • +
    • warning: multiple suitable %0 functions for %1; no 'operator delete' function will be invoked if initialization throws an exception
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-deprecated-altivec-src-compat + clang-diagnostic-deprecated-altivec-src-compat + + Diagnostic text:

    +
      +
    • warning: Current handling of vector bool and vector pixel types in this context are deprecated. The default behaviour will soon change to that implied by the '-altivec-compat=xl' option

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-deprecated-altivec-src-compat - clang-diagnostic-deprecated-altivec-src-compat + clang-diagnostic-deprecate-lax-vec-conv-all + clang-diagnostic-deprecate-lax-vec-conv-all Diagnostic text:

      -
    • warning: Current handling of vector bool and vector pixel types in this context are deprecated. The default behaviour will soon change to that implied by the '-altivec-compat=xl' option
    • +
    • warning: Implicit conversion between vector types ('%0' and '%1') is deprecated. In the future, the behavior implied by '-fno-lax-vector-conversions' will be the default.

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    @@ -29674,13 +33884,62 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-c++2a-compat + clang-diagnostic-c++2a-compat + + Diagnostic text:

    +
      +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: '%0' is a keyword in C++20
    • +
    • warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'consteval' specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'constinit' specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: aggregate initialization of type %0 with user-declared constructors is incompatible with C++20
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: taking address of non-addressable standard library function is incompatible with C++20
    • +
    • warning: this expression will be parsed as explicit(bool) in C++20
    • +
    • warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of implicit 'typename' is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    + + clang-diagnostic-incompatible-function-pointer-types-strict + clang-diagnostic-incompatible-function-pointer-types-strict + + Diagnostic text:

    +
      +
    • warning: incompatible function pointer types %select{%diff{assigning to $ from $|assigning to different types}0,1|%diff{passing $ to parameter of type $|passing to parameter of different type}0,1|%diff{returning $ from a function with result type $|returning from function with different return type}0,1|%diff{converting $ to type $|converting between types}0,1|%diff{initializing $ with an expression of type $|initializing with expression of different type}0,1|%diff{sending $ to parameter of type $|sending to parameter of different type}0,1|%diff{casting $ to type $|casting between types}0,1}2%select{|; dereference with *|; take the address with &|; remove *|; remove &}3
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-atomic-memory-ordering clang-diagnostic-atomic-memory-ordering Diagnostic text:

      -
    • warning: memory order argument to atomic operation is invalid
    • +
    • warning: %select{|success |failure }0memory order argument to atomic operation is invalid

    References

    Diagnostic flags in Clang

    ]]> @@ -29791,6 +34050,57 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
    INFO
    + + clang-diagnostic-c++2a-compat-pedantic + clang-diagnostic-c++2a-compat-pedantic + + Diagnostic text:

    +
      +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: #warning is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{an attribute specifier sequence|%1}0 in this position is incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: %select{delimited|named}0 escape sequences are incompatible with C++ standards before C++23
    • +
    • warning: '%0' is a keyword in C++20
    • +
    • warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'auto' as a functional-style cast is incompatible with C++ standards before C++23
    • +
    • warning: 'consteval' specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'constinit' specifier is incompatible with C++ standards before C++20
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: 'size_t' suffix for literals is incompatible with C++ standards before C++23
    • +
    • warning: aggregate initialization of type %0 with user-declared constructors is incompatible with C++20
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: alias declaration in this context is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: consteval if is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: declaring overloaded %0 as 'static' is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: definition of a %select{static variable|thread_local variable|variable of non-literal type}1 in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: label at end of compound statement is incompatible with C++ standards before C++23
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++23 extension
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: static lambdas are incompatible with C++ standards before C++23
    • +
    • warning: taking address of non-addressable standard library function is incompatible with C++20
    • +
    • warning: this expression will be parsed as explicit(bool) in C++20
    • +
    • warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is incompatible with C++ standards before C++23
    • +
    • warning: use of implicit 'typename' is incompatible with C++ standards before C++20
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is incompatible with C++ standards before C++23
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-nested-anon-types clang-diagnostic-nested-anon-types @@ -29843,6 +34153,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-c++23-default-comp-relaxed-constexpr + clang-diagnostic-c++23-default-comp-relaxed-constexpr + + Diagnostic text:

    +
      +
    • warning: defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|three-way comparison operator}0 that is declared %select{constexpr|consteval}2 but%select{|for which the corresponding implicit 'operator==' }0 invokes a non-constexpr comparison function is a C++23 extension
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-implicit-exception-spec-mismatch clang-diagnostic-implicit-exception-spec-mismatch @@ -29908,6 +34231,21 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-return-local-addr + clang-diagnostic-return-local-addr + + Diagnostic text:

    +
      +
    • warning: %select{address of|reference to}0 stack memory associated with %select{local variable|parameter}2 %1 returned
    • +
    • warning: returning %select{address of|reference to}0 local temporary object
    • +
    • warning: returning address of label, which is local
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-nonportable-vector-initialization clang-diagnostic-nonportable-vector-initialization @@ -29960,6 +34298,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-unaligned-qualifier-implicit-cast + clang-diagnostic-unaligned-qualifier-implicit-cast + + Diagnostic text:

    +
      +
    • warning: implicit cast from type %0 to type %1 drops __unaligned qualifier
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-module-import-in-extern-c clang-diagnostic-module-import-in-extern-c @@ -29999,6 +34350,19 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO + + clang-diagnostic-experimental-header-units + clang-diagnostic-experimental-header-units + + Diagnostic text:

    +
      +
    • warning: the implementation of header units is in an experimental phase
    • +
    +

    References

    +

    Diagnostic flags in Clang

    ]]> +
    + INFO +
    clang-diagnostic-modules-ambiguous-internal-linkage clang-diagnostic-modules-ambiguous-internal-linkage @@ -30059,11 +34423,12 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject
    • +
    • warning: initializer %select{partially |}0overrides prior initialization of this subobject

    References

    Diagnostic flags in Clang

    ]]> - INFO + CRITICAL
    clang-diagnostic-effc++ @@ -30079,44 +34444,29 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO - clang-diagnostic-sequence-point - clang-diagnostic-sequence-point - - Diagnostic text:

    -
      -
    • warning: multiple unsequenced modifications to %0
    • -
    • warning: unsequenced modification and access to %0
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-deprecated-copy-dtor - clang-diagnostic-deprecated-copy-dtor + clang-diagnostic-c2x-compat + clang-diagnostic-c2x-compat Diagnostic text:

      -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared destructor
    • -
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided destructor
    • +
    • warning: '%0' is a keyword in C23

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-partial-availability - clang-diagnostic-partial-availability + clang-diagnostic-sequence-point + clang-diagnostic-sequence-point Diagnostic text:

      -
    • warning: %0 is only available on %1 %2 or newer
    • -
    • warning: %0 is only available on %1 %2 or newer
    • +
    • warning: multiple unsequenced modifications to %0
    • +
    • warning: unsequenced modification and access to %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    @@ -30169,6 +34519,10 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: %select{values of type|enum values with underlying type}2 '%0' should not be used as format arguments; add an explicit cast to %1 instead
  • warning: %select{void function|void method|constructor|destructor}1 %0 should not return a value
  • warning: %select{|empty }0%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++
  • +
  • warning: %sub{subst_format_overflow}0,1,2
  • +
  • warning: %sub{subst_format_overflow}0,1,2
  • +
  • warning: %sub{subst_format_truncation}0,1,2
  • +
  • warning: %sub{subst_format_truncation}0,1,2
  • warning: '%%n' specifier not supported on this platform
  • warning: '%0' is not a valid object format flag
  • warning: '%0' qualifier on function type %1 has no effect
  • @@ -30177,11 +34531,13 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: '%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect
  • warning: '%0' within '%1'
  • warning: '%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument
  • +
  • warning: '&&' of a value and its negation always evaluates to false
  • warning: '&&' within '||'
  • warning: '-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead
  • warning: '/*' within block comment
  • warning: 'static' function %0 declared in header file should be declared 'static inline'
  • warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to %select{true|false}0
  • +
  • warning: '||' of a value and its negation always evaluates to true
  • warning: // comments are not allowed in this language
  • warning: ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 lifetime qualifier on return type is ignored
  • warning: ISO C++ requires field designators to be specified in declaration order; field %1 will be initialized after field %0
  • @@ -30189,6 +34545,7 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: adding %0 to a string does not append to the string
  • warning: all paths through this function will call itself
  • warning: angle-bracketed include <%0> cannot be aliased to double-quoted include "%1"
  • +
  • warning: argument %0 of type %1 with mismatched bound
  • warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension
  • warning: array section %select{lower bound|length}0 is of type 'char'
  • warning: array subscript is of type 'char'
  • @@ -30199,6 +34556,8 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: bitwise or with non-zero value always evaluates to true
  • warning: block pointer variable %0 is %select{uninitialized|null}1 when captured by block
  • warning: call to function without interrupt attribute could clobber interruptee's VFP registers
  • +
  • warning: call to undeclared function %0; ISO C99 and later do not support implicit function declarations
  • +
  • warning: call to undeclared library function '%0' with type %1; ISO C99 and later do not support implicit function declarations
  • warning: calling '%0' with a nonzero argument is unsafe
  • warning: cannot mix positional and non-positional arguments in format string
  • warning: case value not in enumerated type %0
  • @@ -30226,10 +34585,10 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: escaped newline between */ characters at block comment end
  • warning: expected 'ON' or 'OFF' or 'DEFAULT' in pragma
  • warning: expected end of directive in pragma
  • -
  • warning: explicitly assigning value of variable of type %0 to itself
  • -
  • warning: explicitly assigning value of variable of type %0 to itself
  • -
  • warning: explicitly moving variable of type %0 to itself
  • -
  • warning: explicitly moving variable of type %0 to itself
  • +
  • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1
  • +
  • warning: explicitly assigning value of variable of type %0 to itself%select{|; did you mean to assign to member %2?}1
  • +
  • warning: explicitly moving variable of type %0 to itself%select{|; did you mean to move to member %2?}1
  • +
  • warning: explicitly moving variable of type %0 to itself%select{|; did you mean to move to member %2?}1
  • warning: expression result unused
  • warning: expression result unused; should this cast be to 'void'?
  • warning: expression with side effects has no effect in an unevaluated context
  • @@ -30254,11 +34613,11 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: ignoring temporary created by a constructor declared with %0 attribute
  • warning: ignoring temporary created by a constructor declared with %0 attribute: %1
  • warning: implicit declaration of function %0
  • -
  • warning: implicit declaration of function %0 is invalid in C99
  • warning: implicitly declaring library function '%0' with type %1
  • warning: incomplete format specifier
  • warning: initializer %select{partially |}0overrides prior initialization of this subobject
  • warning: initializer %select{partially |}0overrides prior initialization of this subobject
  • +
  • warning: initializer %select{partially |}0overrides prior initialization of this subobject
  • warning: initializer order does not match the declaration order
  • warning: invalid conversion specifier '%0'
  • warning: invalid position specified for %select{field width|field precision}0
  • @@ -30289,6 +34648,7 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: non-void function does not return a value in all control paths
  • warning: non-void lambda does not return a value
  • warning: non-void lambda does not return a value in all control paths
  • +
  • warning: not packing field %0 as it is non-POD for the purposes of layout
  • warning: null passed to a callee that requires a non-null argument
  • warning: null returned from %select{function|method}0 that requires a non-null return value
  • warning: object format flags cannot be used with '%0' conversion specifier
  • @@ -30299,6 +34659,7 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: overlapping comparisons always evaluate to %select{false|true}0
  • warning: overloaded operator %select{>>|<<}0 has higher precedence than comparison operator
  • warning: parameter %0 set but not used
  • +
  • warning: parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not support implicit int
  • warning: performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0
  • warning: performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior
  • warning: position arguments in format strings start counting at 1 (not 0)
  • @@ -30327,6 +34688,7 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: trigraph ends block comment
  • warning: trigraph ignored
  • warning: type specifier missing, defaults to 'int'
  • +
  • warning: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int
  • warning: unexpected token in pragma diagnostic
  • warning: unknown pragma ignored
  • warning: unknown pragma in STDC namespace
  • @@ -30349,6 +34711,10 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: variable %0 is uninitialized when passed as a const reference argument here
  • warning: variable %0 is uninitialized when used within its own initialization
  • warning: variable %0 set but not used
  • +
  • warning: variable length arrays in C++ are a Clang extension
  • +
  • warning: variable length arrays in C++ are a Clang extension
  • +
  • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
  • +
  • warning: variable length arrays in C++ are a Clang extension; did you mean to use 'static_assert'?
  • warning: variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 used in loop condition not modified in loop body
  • warning: zero field width in scanf format string is unused
  • @@ -30442,7 +34808,7 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve

    References

    Diagnostic flags in Clang

    ]]> - INFO + CRITICAL clang-diagnostic-vector-conversions @@ -30482,6 +34848,7 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve
  • warning: 'long long' is a C++11 extension
  • warning: 'template' keyword outside of a template
  • warning: 'typename' occurs outside of a template
  • +
  • warning: [[]] attributes are a C++11 extension
  • warning: alias declarations are a C++11 extension
  • warning: befriending enumeration type %0 is a C++11 extension
  • warning: commas at the end of enumerator lists are a C++11 extension
  • @@ -30511,555 +34878,499 @@ std::vector<int* const> vector; // error: static assertion failed: std::ve INFO
    - clang-diagnostic-c++1y-extensions - clang-diagnostic-c++1y-extensions - - Diagnostic text:

    -
      -
    • warning: 'decltype(auto)' type specifier is a C++14 extension
    • -
    • warning: binary integer literals are a C++14 extension
    • -
    • warning: initialized lambda captures are a C++14 extension
    • -
    • warning: multiple return statements in constexpr function is a C++14 extension
    • -
    • warning: type definition in a constexpr %select{function|constructor}0 is a C++14 extension
    • -
    • warning: use of the %0 attribute is a C++14 extension
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++14 extension
    • -
    • warning: variable declaration in a constexpr %select{function|constructor}0 is a C++14 extension
    • -
    • warning: variable templates are a C++14 extension
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-c++1z-extensions - clang-diagnostic-c++1z-extensions - - Diagnostic text:

    -
      -
    • warning: '%select{if|switch}0' initialization statements are a C++17 extension
    • -
    • warning: 'begin' and 'end' returning different types (%0 and %1) is a C++17 extension
    • -
    • warning: 'constexpr' on lambda expressions is a C++17 extension
    • -
    • warning: 'static_assert' with no message is a C++17 extension
    • -
    • warning: ISO C++ standards before C++17 do not allow new expression for type %0 to use list-initialization
    • -
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are a C++17 extension
    • -
    • warning: capture of '*this' by copy is a C++17 extension
    • -
    • warning: constexpr if is a C++17 extension
    • -
    • warning: decomposition declarations are a C++17 extension
    • -
    • warning: default scope specifier for attributes is a C++17 extension
    • -
    • warning: hexadecimal floating literals are a C++17 feature
    • -
    • warning: inline variables are a C++17 extension
    • -
    • warning: nested namespace definition is a C++17 extension; define each namespace separately
    • -
    • warning: pack expansion of using declaration is a C++17 extension
    • -
    • warning: pack fold expression is a C++17 extension
    • -
    • warning: template template parameter using 'typename' is a C++17 extension
    • -
    • warning: use of multiple declarators in a single using declaration is a C++17 extension
    • -
    • warning: use of the %0 attribute is a C++17 extension
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-c++2a-extensions - clang-diagnostic-c++2a-extensions - - Diagnostic text:

    -
      -
    • warning: constexpr constructor that does not initialize all members is a C++20 extension
    • -
    • warning: constexpr union constructor that does not initialize any member is a C++20 extension
    • -
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension
    • -
    • warning: default member initializer for bit-field is a C++20 extension
    • -
    • warning: defaulted comparison operators are a C++20 extension
    • -
    • warning: designated initializers are a C++20 extension
    • -
    • warning: explicit capture of 'this' with a capture default of '=' is a C++20 extension
    • -
    • warning: explicit template parameter list for lambdas is a C++20 extension
    • -
    • warning: explicit(bool) is a C++20 extension
    • -
    • warning: function try block in constexpr %select{function|constructor}0 is a C++20 extension
    • -
    • warning: initialized lambda pack captures are a C++20 extension
    • -
    • warning: inline nested namespace definition is a C++20 extension
    • -
    • warning: invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension
    • -
    • warning: member using declaration naming a non-member enumerator is a C++20 extension
    • -
    • warning: range-based for loop initialization statements are a C++20 extension
    • -
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is a C++20 extension
    • -
    • warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension
    • -
    • warning: use of the %0 attribute is a C++20 extension
    • -
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++20 extension
    • -
    • warning: using declaration naming a scoped enumerator is a C++20 extension
    • -
    • warning: using enum declaration is a C++20 extension
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-msvc-include - clang-diagnostic-msvc-include - - Diagnostic text:

    -
      -
    • warning: #include resolved using non-portable Microsoft search rules as: %0
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-frame-larger-than= - clang-diagnostic-frame-larger-than= - - Diagnostic text:

    -
      -
    • warning: %0
    • -
    • warning: stack frame size (%0) exceeds limit (%1) in '%2'
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-spirv-compat - clang-diagnostic-spirv-compat - - Diagnostic text:

    -
      -
    • warning: sampler initializer has invalid %0 bits
    • -
    -

    References

    -

    Diagnostic flags in Clang

    ]]> -
    - INFO -
    - - clang-diagnostic-integer-overflow - clang-diagnostic-integer-overflow + clang-diagnostic-deprecated-copy-dtor + clang-diagnostic-deprecated-copy-dtor Diagnostic text:

      -
    • warning: overflow in expression; result is %0 with type %1
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-declared destructor
    • +
    • warning: definition of implicit copy %select{constructor|assignment operator}1 for %0 is deprecated because it has a user-provided destructor

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-fixed-point-overflow - clang-diagnostic-fixed-point-overflow + clang-diagnostic-c++1y-extensions + clang-diagnostic-c++1y-extensions Diagnostic text:

      -
    • warning: overflow in expression; result is %0 with type %1
    • +
    • warning: 'decltype(auto)' type specifier is a C++14 extension
    • +
    • warning: binary integer literals are a C++14 extension
    • +
    • warning: initialized lambda captures are a C++14 extension
    • +
    • warning: multiple return statements in constexpr function is a C++14 extension
    • +
    • warning: type definition in a constexpr %select{function|constructor}0 is a C++14 extension
    • +
    • warning: use of the %0 attribute is a C++14 extension
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++14 extension
    • +
    • warning: variable declaration in a constexpr %select{function|constructor}0 is a C++14 extension
    • +
    • warning: variable templates are a C++14 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-constant-evaluated - clang-diagnostic-constant-evaluated + clang-diagnostic-c++1z-extensions + clang-diagnostic-c++1z-extensions Diagnostic text:

      -
    • warning: '%0' will always evaluate to 'true' in a manifestly constant-evaluated expression
    • +
    • warning: '%select{if|switch}0' initialization statements are a C++17 extension
    • +
    • warning: 'begin' and 'end' returning different types (%0 and %1) is a C++17 extension
    • +
    • warning: 'constexpr' on lambda expressions is a C++17 extension
    • +
    • warning: 'static_assert' with no message is a C++17 extension
    • +
    • warning: ISO C++ standards before C++17 do not allow new expression for type %0 to use list-initialization
    • +
    • warning: attributes on %select{a namespace|an enumerator}0 declaration are a C++17 extension
    • +
    • warning: capture of '*this' by copy is a C++17 extension
    • +
    • warning: constexpr if is a C++17 extension
    • +
    • warning: decomposition declarations are a C++17 extension
    • +
    • warning: default scope specifier for attributes is a C++17 extension
    • +
    • warning: hexadecimal floating literals are a C++17 feature
    • +
    • warning: inline variables are a C++17 extension
    • +
    • warning: nested namespace definition is a C++17 extension; define each namespace separately
    • +
    • warning: pack expansion of using declaration is a C++17 extension
    • +
    • warning: pack fold expression is a C++17 extension
    • +
    • warning: template template parameter using 'typename' is a C++17 extension
    • +
    • warning: use of multiple declarators in a single using declaration is a C++17 extension
    • +
    • warning: use of the %0 attribute is a C++17 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-stack-exhausted - clang-diagnostic-stack-exhausted + clang-diagnostic-c++2a-extensions + clang-diagnostic-c++2a-extensions Diagnostic text:

      -
    • warning: stack nearly exhausted; compilation time may suffer, and crashes due to stack overflow are likely
    • +
    • warning: aggregate initialization of type %0 from a parenthesized list of values is a C++20 extension
    • +
    • warning: captured structured bindings are a C++20 extension
    • +
    • warning: constexpr constructor that does not initialize all members is a C++20 extension
    • +
    • warning: constexpr union constructor that does not initialize any member is a C++20 extension
    • +
    • warning: decomposition declaration declared %plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension
    • +
    • warning: default member initializer for bit-field is a C++20 extension
    • +
    • warning: defaulted comparison operators are a C++20 extension
    • +
    • warning: designated initializers are a C++20 extension
    • +
    • warning: explicit capture of 'this' with a capture default of '=' is a C++20 extension
    • +
    • warning: explicit template parameter list for lambdas is a C++20 extension
    • +
    • warning: explicit(bool) is a C++20 extension
    • +
    • warning: function try block in constexpr %select{function|constructor}0 is a C++20 extension
    • +
    • warning: initialized lambda pack captures are a C++20 extension
    • +
    • warning: inline nested namespace definition is a C++20 extension
    • +
    • warning: invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension
    • +
    • warning: missing 'typename' prior to dependent type name %0%1; implicit 'typename' is a C++20 extension
    • +
    • warning: range-based for loop initialization statements are a C++20 extension
    • +
    • warning: uninitialized variable in a constexpr %select{function|constructor}0 is a C++20 extension
    • +
    • warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension
    • +
    • warning: use of the %0 attribute is a C++20 extension
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++20 extension
    • +
    • warning: using declaration naming a scoped enumerator is a C++20 extension
    • +
    • warning: using enum declaration is a C++20 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-stack-protector - clang-diagnostic-stack-protector + clang-diagnostic-c++2b-extensions + clang-diagnostic-c++2b-extensions Diagnostic text:

      -
    • warning: Unable to protect inline asm that clobbers stack pointer against stack clash
    • +
    • warning: %select{an attribute specifier sequence|%0}1 in this position is a C++23 extension
    • +
    • warning: 'size_t' suffix for literals is a C++23 extension
    • +
    • warning: alias declaration in this context is a C++23 extension
    • +
    • warning: consteval if is a C++23 extension
    • +
    • warning: declaring overloaded %0 as 'static' is a C++23 extension
    • +
    • warning: definition of a %select{static|thread_local}1 variable in a constexpr %select{function|constructor}0 is a C++23 extension
    • +
    • warning: label at end of compound statement is a C++23 extension
    • +
    • warning: lambda without a parameter clause is a C++23 extension
    • +
    • warning: static lambdas are a C++23 extension
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is a C++23 extension
    • +
    • warning: use of this statement in a constexpr %select{function|constructor}0 is a C++23 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-slh-asm-goto - clang-diagnostic-slh-asm-goto + clang-diagnostic-c++2c-extensions + clang-diagnostic-c++2c-extensions Diagnostic text:

      -
    • warning: Speculative load hardening does not protect functions with asm goto
    • +
    • warning: placeholder variables are a C++2c extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-poison-system-directories - clang-diagnostic-poison-system-directories + clang-diagnostic-c2x-extensions + clang-diagnostic-c2x-extensions Diagnostic text:

      -
    • warning: include location '%0' is unsafe for cross-compilation
    • +
    • warning: '_BitInt' suffix for literals is a C23 extension
    • +
    • warning: '_Static_assert' with no message is a C23 extension
    • +
    • warning: 'nullptr' is a C23 extension
    • +
    • warning: [[]] attributes are a C23 extension
    • +
    • warning: label at end of compound statement is a C23 extension
    • +
    • warning: label followed by a declaration is a C23 extension
    • +
    • warning: omitting the parameter name in a function definition is a C23 extension
    • +
    • warning: use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is a C23 extension
    • +
    • warning: use of an empty initializer is a C23 extension

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unsupported-abi - clang-diagnostic-unsupported-abi + clang-diagnostic-msvc-include + clang-diagnostic-msvc-include Diagnostic text:

      -
    • warning: float ABI '%0' is not supported by current library
    • +
    • warning: #include resolved using non-portable Microsoft search rules as: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-overriding-t-option - clang-diagnostic-overriding-t-option + clang-diagnostic-frame-larger-than= + clang-diagnostic-frame-larger-than= Diagnostic text:

      -
    • warning: overriding '%0' option with '%1'
    • +
    • warning: %0
    • +
    • warning: stack frame size (%0) exceeds limit (%1) in '%2'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-missing-sysroot - clang-diagnostic-missing-sysroot + clang-diagnostic-spirv-compat + clang-diagnostic-spirv-compat Diagnostic text:

      -
    • warning: no such sysroot directory: '%0'
    • +
    • warning: sampler initializer has invalid %0 bits

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-incompatible-sysroot - clang-diagnostic-incompatible-sysroot + clang-diagnostic-integer-overflow + clang-diagnostic-integer-overflow Diagnostic text:

      -
    • warning: using sysroot for '%0' but targeting '%1'
    • +
    • warning: overflow in expression; result is %0 with type %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-div-by-zero - clang-diagnostic-div-by-zero + clang-diagnostic-partial-availability + clang-diagnostic-partial-availability Diagnostic text:

      -
    • warning: %select{remainder|division}0 by zero is undefined
    • +
    • warning: %0 is only available on %1 %2 or newer
    • +
    • warning: %0 is only available on %1 %2 or newer

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-debug-compression-unavailable - clang-diagnostic-debug-compression-unavailable + clang-diagnostic-fixed-point-overflow + clang-diagnostic-fixed-point-overflow Diagnostic text:

      -
    • warning: cannot compress debug sections (zlib not installed)
    • +
    • warning: overflow in expression; result is %0 with type %1

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-slash-u-filename - clang-diagnostic-slash-u-filename + clang-diagnostic-enum-constexpr-conversion + clang-diagnostic-enum-constexpr-conversion Diagnostic text:

      -
    • warning: '/U%0' treated as the '/U' option
    • +
    • warning: integer value %0 is outside the valid range of values [%1, %2] for the enumeration type %3

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - INFO + CRITICAL
    - clang-diagnostic-msvc-not-found - clang-diagnostic-msvc-not-found + clang-diagnostic-constant-evaluated + clang-diagnostic-constant-evaluated Diagnostic text:

      -
    • warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt
    • +
    • warning: '%0' will always evaluate to 'true' in a manifestly constant-evaluated expression

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-darwin-sdk-settings - clang-diagnostic-darwin-sdk-settings + clang-diagnostic-stack-exhausted + clang-diagnostic-stack-exhausted Diagnostic text:

      -
    • warning: SDK settings were ignored as 'SDKSettings.json' could not be parsed
    • +
    • warning: stack nearly exhausted; compilation time may suffer, and crashes due to stack overflow are likely

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-stdlibcxx-not-found - clang-diagnostic-stdlibcxx-not-found + clang-diagnostic-nan-infinity-disabled + clang-diagnostic-nan-infinity-disabled Diagnostic text:

      -
    • warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead
    • +
    • warning: use of %select{infinity|NaN}0%select{| via a macro}1 is undefined behavior due to the currently enabled floating-point options

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-override-module - clang-diagnostic-override-module + clang-diagnostic-stack-protector + clang-diagnostic-stack-protector Diagnostic text:

      -
    • warning: overriding the module target triple with %0
    • +
    • warning: unable to protect inline asm that clobbers stack pointer against stack clash

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unable-to-open-stats-file - clang-diagnostic-unable-to-open-stats-file + clang-diagnostic-slh-asm-goto + clang-diagnostic-slh-asm-goto Diagnostic text:

      -
    • warning: unable to open statistics output file '%0': '%1'
    • +
    • warning: speculative load hardening does not protect functions with asm goto

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-analyzer-incompatible-plugin - clang-diagnostic-analyzer-incompatible-plugin + clang-diagnostic-objc-duplicate-category-definition + clang-diagnostic-objc-duplicate-category-definition Diagnostic text:

      -
    • warning: checker plugin '%0' is not compatible with this version of the analyzer
    • +
    • warning: duplicate definition of category %1 on interface %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-module-file-config-mismatch - clang-diagnostic-module-file-config-mismatch + clang-diagnostic-invalid-feature-combination + clang-diagnostic-invalid-feature-combination Diagnostic text:

      -
    • warning: module file %0 cannot be loaded due to a configuration mismatch with the current compilation
    • +
    • warning: invalid feature combination: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    - CRITICAL + INFO
    - clang-diagnostic-psabi - clang-diagnostic-psabi + clang-diagnostic-knl-knm-isa-support-removed + clang-diagnostic-knl-knm-isa-support-removed Diagnostic text:

      -
    • warning: AVX vector %select{return|argument}0 of type %1 without '%2' enabled changes the ABI
    • +
    • warning: KNL, KNM related Intel Xeon Phi CPU's specific ISA's supports will be removed in LLVM 19.

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-c++1z-compat-mangling - clang-diagnostic-c++1z-compat-mangling + clang-diagnostic-sloc-usage + clang-diagnostic-sloc-usage Diagnostic text:

      -
    • warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
    • +
    • remark: source manager location address space usage:

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-backslash-newline-escape - clang-diagnostic-backslash-newline-escape + clang-diagnostic-apinotes + clang-diagnostic-apinotes Diagnostic text:

      -
    • warning: backslash and newline separated by space
    • +
    • warning: %0

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-dollar-in-identifier-extension - clang-diagnostic-dollar-in-identifier-extension + clang-diagnostic-nonportable-private-apinotes-path + clang-diagnostic-nonportable-private-apinotes-path Diagnostic text:

      -
    • warning: '$' in identifier
    • +
    • warning: private API notes file for module '%0' should be named '%0_private.apinotes', not '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-language-extension-token - clang-diagnostic-language-extension-token + clang-diagnostic-nonportable-private-system-apinotes-path + clang-diagnostic-nonportable-private-system-apinotes-path Diagnostic text:

      -
    • warning: extension used
    • +
    • warning: private API notes file for module '%0' should be named '%0_private.apinotes', not '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unicode-whitespace - clang-diagnostic-unicode-whitespace + clang-diagnostic-poison-system-directories + clang-diagnostic-poison-system-directories Diagnostic text:

      -
    • warning: treating Unicode character as whitespace
    • +
    • warning: include location '%0' is unsafe for cross-compilation

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unicode-homoglyph - clang-diagnostic-unicode-homoglyph + clang-diagnostic-overriding-option + clang-diagnostic-overriding-option Diagnostic text:

      -
    • warning: treating Unicode character <U+%0> as identifier character rather than as '%1' symbol
    • +
    • warning: overriding '%0' option with '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unicode-zero-width - clang-diagnostic-unicode-zero-width + clang-diagnostic-overriding-t-option + clang-diagnostic-overriding-t-option Diagnostic text:

      -
    • warning: identifier contains Unicode character <U+%0> that is invisible in some environments
    • +
    • warning: overriding '%0' option with '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-delimited-escape-sequence-extension - clang-diagnostic-delimited-escape-sequence-extension + clang-diagnostic-missing-sysroot + clang-diagnostic-missing-sysroot Diagnostic text:

      -
    • warning: delimited escape sequences are a Clang extension
    • +
    • warning: no such sysroot directory: '%0'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-unknown-escape-sequence - clang-diagnostic-unknown-escape-sequence + clang-diagnostic-incompatible-sysroot + clang-diagnostic-incompatible-sysroot Diagnostic text:

      -
    • warning: unknown escape sequence '\%0'
    • +
    • warning: using sysroot for '%0' but targeting '%1'

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-include-next-outside-header - clang-diagnostic-include-next-outside-header + clang-diagnostic-debug-compression-unavailable + clang-diagnostic-debug-compression-unavailable Diagnostic text:

      -
    • warning: #include_next in primary source file; will search from start of include path
    • +
    • warning: cannot compress debug sections (%0 not enabled)

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    - clang-diagnostic-include-next-absolute-path - clang-diagnostic-include-next-absolute-path + clang-diagnostic-delayed-template-parsing-in-cxx20 + clang-diagnostic-delayed-template-parsing-in-cxx20 Diagnostic text:

      -
    • warning: #include_next in file found relative to primary source file or found by absolute path; will search from start of include path
    • +
    • warning: -fdelayed-template-parsing is deprecated after C++20

    References

    -

    Diagnostic flags in Clang

    ]]> +

    Diagnostic flags in Clang

    ]]>
    INFO
    diff --git a/cxx-sensors/src/test/java/org/sonar/cxx/sensors/clangsa/CxxClangSARuleRepositoryTest.java b/cxx-sensors/src/test/java/org/sonar/cxx/sensors/clangsa/CxxClangSARuleRepositoryTest.java index 4afd48785e..17e8913c40 100644 --- a/cxx-sensors/src/test/java/org/sonar/cxx/sensors/clangsa/CxxClangSARuleRepositoryTest.java +++ b/cxx-sensors/src/test/java/org/sonar/cxx/sensors/clangsa/CxxClangSARuleRepositoryTest.java @@ -37,7 +37,7 @@ void createRulesTest() { def.define(context); RulesDefinition.Repository repo = context.repository(CxxClangSARuleRepository.KEY); - assertThat(repo.rules()).hasSize(93); + assertThat(repo.rules()).hasSize(98); } } diff --git a/cxx-sensors/src/test/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepositoryTest.java b/cxx-sensors/src/test/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepositoryTest.java index 14c3faf614..29574c998c 100644 --- a/cxx-sensors/src/test/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepositoryTest.java +++ b/cxx-sensors/src/test/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepositoryTest.java @@ -36,7 +36,7 @@ void createRulesTest() { def.define(context); RulesDefinition.Repository repo = context.repository(CxxClangTidyRuleRepository.KEY); - assertThat(repo.rules()).hasSize(1355); + assertThat(repo.rules()).hasSize(1511); } } diff --git a/cxx-sensors/src/tools/clangtidy_createrules.py b/cxx-sensors/src/tools/clangtidy_createrules.py index c50256acf3..d64f6910a8 100644 --- a/cxx-sensors/src/tools/clangtidy_createrules.py +++ b/cxx-sensors/src/tools/clangtidy_createrules.py @@ -361,7 +361,7 @@ def rstfiles_to_rules_xml(directory, fix_urls): def contains_required_fields(entry_value): FIELDS = ["!name", "!anonymous", "!superclasses", - "Class", "DefaultSeverity", "Text"] + "Class", "DefaultSeverity", "Summary"] for field in FIELDS: if field not in entry_value: return False @@ -502,11 +502,11 @@ def calculate_rule_type_and_severity(diagnostics): def generate_description(diag_group_name, diagnostics): html_lines = ["

    Diagnostic text:

    ", "
      "] all_diagnostics_are_remarks = True - for diagnostic in sorted(diagnostics, key=lambda k: k['Text']): + for diagnostic in sorted(diagnostics, key=lambda k: k['Summary']): diag_class = diagnostic["Class"]["def"] all_diagnostics_are_remarks = all_diagnostics_are_remarks and ( diag_class == "CLASS_REMARK") - diag_text = diagnostic["Text"] + diag_text = diagnostic["Summary"] diag_class_printable = DIAG_CLASS[diag_class]["printable"] diag_text_escaped = html.escape(diag_text, quote=False) html_lines.append("
    • %s: %s
    • " % diff --git a/cxx-sensors/src/tools/clangtidy_createrules.pyproj b/cxx-sensors/src/tools/clangtidy_createrules.pyproj new file mode 100644 index 0000000000..920b9326e5 --- /dev/null +++ b/cxx-sensors/src/tools/clangtidy_createrules.pyproj @@ -0,0 +1,39 @@ + + + Debug + 2.0 + 46164d90-7249-4216-b115-b99d1420d74c + . + clangtidy_createrules.py + + + . + . + clangtidy_createrules + clangtidy_createrules + Standard Python launcher + diagnostics "C:\Development\git\sonar-cxx\cxx-sensors\src\tools\diagnostic.json" > "C:\Development\git\sonar-cxx\cxx-sensors\src\tools\diagnostic_new.xml" + False + + + true + false + + + true + false + + + + + + + + + + + + + \ No newline at end of file diff --git a/cxx-sensors/src/tools/clangtidy_createrules.sln b/cxx-sensors/src/tools/clangtidy_createrules.sln new file mode 100644 index 0000000000..03cebfd420 --- /dev/null +++ b/cxx-sensors/src/tools/clangtidy_createrules.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31911.196 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "clangtidy_createrules", "clangtidy_createrules.pyproj", "{46164D90-7249-4216-B115-B99D1420D74C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {46164D90-7249-4216-B115-B99D1420D74C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46164D90-7249-4216-B115-B99D1420D74C}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C4A6BDFE-BF78-40A6-B31B-19D9B6E2BBC2} + EndGlobalSection +EndGlobal