diff --git a/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/ClangTidyParser.java b/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/ClangTidyParser.java
index 69dfc6813..4451c67a0 100644
--- a/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/ClangTidyParser.java
+++ b/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/ClangTidyParser.java
@@ -119,7 +119,7 @@ private static void parseRuleIds(LineData data) {
int pos = data.info.lastIndexOf('[');
if (pos != -1) {
for (var ruleId : data.info.substring(pos + 1, data.info.length() - 1).split(",")) {
- ruleId = ruleId.trim();
+ ruleId = mapDeprecatedRules(ruleId.trim());
if (data.ruleId == null) {
data.ruleId = ruleId;
} else {
@@ -142,6 +142,76 @@ private static void parseRuleIds(LineData data) {
}
}
+ private static String mapDeprecatedRules(String ruleId) {
+
+ // TODO: put data into hashmap
+ switch (ruleId) {
+
+ // C++11 (0x)
+ case "clang-diagnostic-c++0x-compat":
+ return "clang-diagnostic-c++11-compat";
+ case "clang-diagnostic-c++0x-extensions":
+ return "clang-diagnostic-c++11-extensions";
+ case "clang-diagnostic-pre-c++0x-compat":
+ return "clang-diagnostic-pre-c++11-compat";
+ case "clang-diagnostic-pre-c++0x-compat-pedantic":
+ return "clang-diagnostic-pre-c++11-compat-pedantic";
+
+ // C++14 (1y)
+ case "clang-diagnostic-c++1y-compat":
+ return "clang-diagnostic-c++14-compat";
+ case "clang-diagnostic-c++1y-extensions":
+ return "clang-diagnostic-c++14-extensions";
+ case "clang-diagnostic-pre-c++1y-compat":
+ return "clang-diagnostic-pre-c++14-compat";
+ case "clang-diagnostic-pre-c++1y-compat-pedantic":
+ return "clang-diagnostic-pre-c++14-compat-pedantic";
+
+ // C++17 (1z)
+ case "clang-diagnostic-c++1z-compat":
+ return "clang-diagnostic-c++17-compat";
+ case "clang-diagnostic-c++1z-extensions":
+ return "clang-diagnostic-c++17-extensions";
+ case "clang-diagnostic-pre-c++1z-compat":
+ return "clang-diagnostic-pre-c++17-compat";
+ case "clang-diagnostic-pre-c++1z-compat-pedantic":
+ return "clang-diagnostic-pre-c++17-compat-pedantic";
+
+ // C++20 (2a)
+ case "clang-diagnostic-c++2a-compat":
+ return "clang-diagnostic-c++20-compat";
+ case "clang-diagnostic-c++2a-extensions":
+ return "clang-diagnostic-c++20-extensions";
+ case "clang-diagnostic-pre-c++2a-compat":
+ return "clang-diagnostic-pre-c++20-compat";
+ case "clang-diagnostic-pre-c++2a-compat-pedantic":
+ return "clang-diagnostic-pre-c++20-compat-pedantic";
+
+ // C++23 (2b)
+ case "clang-diagnostic-c++2b-compat":
+ return "clang-diagnostic-c++23-compat";
+ case "clang-diagnostic-c++2b-extensions":
+ return "clang-diagnostic-c++23-extensions";
+ case "clang-diagnostic-pre-c++2b-compat":
+ return "clang-diagnostic-pre-c++23-compat";
+ case "clang-diagnostic-pre-c++2b-compat-pedantic":
+ return "clang-diagnostic-pre-c++23-compat-pedantic";
+
+ // C++26 (2c)
+ case "clang-diagnostic-c++2c-compat":
+ return "clang-diagnostic-c++26-compat";
+ case "clang-diagnostic-c++2c-extensions":
+ return "clang-diagnostic-c++26-extensions";
+ case "clang-diagnostic-pre-c++2c-compat":
+ return "clang-diagnostic-pre-c++26-compat";
+ case "clang-diagnostic-pre-c++2c-compat-pedantic":
+ return "clang-diagnostic-pre-c++26-compat-pedantic";
+
+ default:
+ return ruleId;
+ }
+ }
+
private static String getDefaultRuleId(String level) {
return map.getOrDefault(level, "clang-diagnostic-unknown");
}
diff --git a/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepository.java b/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepository.java
index 53cc538c6..8796b77e9 100644
--- a/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepository.java
+++ b/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepository.java
@@ -42,7 +42,95 @@ public CxxClangTidyRuleRepository(ServerFileSystem fileSystem, RulesDefinitionXm
@Override
public void prepareRule(NewRule rule) {
- rule.addDeprecatedRuleKey("ClangTidy", rule.key()); // V1.3 repository name
+ // V1.3 repository name
+ rule.addDeprecatedRuleKey("ClangTidy", rule.key());
+
+ switch (rule.key()) {
+
+ // C++11 (0x)
+ case "clang-diagnostic-c++11-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++0x-compat");
+ break;
+ case "clang-diagnostic-c++11-extensions":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++0x-extensions");
+ break;
+ case "clang-diagnostic-pre-c++11-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++0x-compat");
+ break;
+ case "clang-diagnostic-pre-c++11-compat-pedantic":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++0x-compat-pedantic");
+ break;
+
+ // C++14 (1y)
+ case "clang-diagnostic-c++14-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++1y-compat");
+ break;
+ case "clang-diagnostic-c++14-extensions":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++1y-extensions");
+ break;
+ case "clang-diagnostic-pre-c++14-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++1y-compat");
+ break;
+ case "clang-diagnostic-pre-c++14-compat-pedantic":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++1y-compat-pedantic");
+ break;
+
+ // C++17 (1z)
+ case "clang-diagnostic-c++17-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++1z-compat");
+ break;
+ case "clang-diagnostic-c++17-extensions":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++1z-extensions");
+ break;
+ case "clang-diagnostic-pre-c++17-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++1z-compat");
+ break;
+ case "clang-diagnostic-pre-c++17-compat-pedantic":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++1z-compat-pedantic");
+ break;
+
+ // C++20 (2a)
+ case "clang-diagnostic-c++20-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++2a-compat");
+ break;
+ case "clang-diagnostic-c++20-extensions":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++2a-extensions");
+ break;
+ case "clang-diagnostic-pre-c++20-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++2a-compat");
+ break;
+ case "clang-diagnostic-pre-c++20-compat-pedantic":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++2a-compat-pedantic");
+ break;
+
+ // C++23 (2b)
+ case "clang-diagnostic-c++23-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++2b-compat");
+ break;
+ case "clang-diagnostic-c++23-extensions":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++2b-extensions");
+ break;
+ case "clang-diagnostic-pre-c++23-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++2b-compat");
+ break;
+ case "clang-diagnostic-pre-c++23-compat-pedantic":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++2b-compat-pedantic");
+ break;
+
+ // C++26 (2c)
+ case "clang-diagnostic-c++26-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++2c-compat");
+ break;
+ case "clang-diagnostic-c++26-extensions":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-c++2c-extensions");
+ break;
+ case "clang-diagnostic-pre-c++26-compat":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++2c-compat");
+ break;
+ case "clang-diagnostic-pre-c++26-compat-pedantic":
+ rule.addDeprecatedRuleKey(KEY, "clang-diagnostic-pre-c++2c-compat-pedantic");
+ break;
+ }
}
}
diff --git a/cxx-sensors/src/main/resources/clangtidy.xml b/cxx-sensors/src/main/resources/clangtidy.xml
index 4e3ab11c7..883374709 100644
--- a/cxx-sensors/src/main/resources/clangtidy.xml
+++ b/cxx-sensors/src/main/resources/clangtidy.xml
@@ -21046,178 +21046,6 @@ Derived(); // and so temporary construction is okay
INFO
-
- clang-diagnostic-c++0x-compat
- clang-diagnostic-c++0x-compat
-
- Diagnostic text:
-
-- warning: '%0' in a raw string literal delimiter is incompatible with standards before C++2c
-- 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|call to 'size()'|call to 'data()'}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: '= delete' with a message is incompatible with C++ standards before C++2c
-- 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: an attribute specifier sequence attached to a structured binding declaration is incompatible with C++ standards before C++2c
-- 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 for alias templates is 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: 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: pack indexing is incompatible with C++ standards before C++2c
-- warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
-- warning: placeholder variables are incompatible with C++ standards before C++2c
-- 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-c++0x-extensions
- clang-diagnostic-c++0x-extensions
-
- 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: [[]] attributes are a C++11 extension
-- warning: alias declarations are 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: lambdas are a C++11 extension
-- 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
-
-References
-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|call to 'size()'|call to 'data()'}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
]]>
-
- CRITICAL
-
clang-diagnostic-c++11-compat
clang-diagnostic-c++11-compat
@@ -22155,132 +21983,6 @@ Derived(); // and so temporary construction is okay
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-compat
- clang-diagnostic-c++1z-compat
-
- Diagnostic text:
-
-- warning: '%0' in a raw string literal delimiter is incompatible with standards before C++2c
-- 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: '= delete' with a message is incompatible with C++ standards before C++2c
-- 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: an attribute specifier sequence attached to a structured binding declaration is incompatible with C++ standards before C++2c
-- warning: captured structured bindings are incompatible with C++ standards before C++20
-- warning: class template argument deduction for alias templates is 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: 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: pack indexing is incompatible with C++ standards before C++2c
-- warning: passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20
-- warning: placeholder variables are incompatible with C++ standards before C++2c
-- 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-c++1z-compat-mangling
- clang-diagnostic-c++1z-compat-mangling
-
- Diagnostic text:
-
-- warning: mangled name of %0 will change in C++17 due to non-throwing exception specification in function signature
-
-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++20-attribute-extensions
clang-diagnostic-c++20-attribute-extensions
@@ -22538,195 +22240,6 @@ Derived(); // and so temporary construction is okay
INFO
-
- clang-diagnostic-c++2a-compat
- clang-diagnostic-c++2a-compat
-
- Diagnostic text:
-
-- warning: '%0' in a raw string literal delimiter is incompatible with standards before C++2c
-- 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: '= delete' with a message is incompatible with C++ standards before C++2c
-- 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: an attribute specifier sequence attached to a structured binding declaration is incompatible with C++ standards before C++2c
-- 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: 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: pack indexing is incompatible with C++ standards before C++2c
-- warning: placeholder variables are incompatible with C++ standards before C++2c
-- 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-c++2a-compat-pedantic
- clang-diagnostic-c++2a-compat-pedantic
-
- Diagnostic text:
-
-- warning: '%0' in a raw string literal delimiter is incompatible with standards before C++2c
-- warning: '%0' in a raw string literal delimiter is incompatible with standards before C++2c
-- 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: '= delete' with a message is incompatible with C++ standards before C++2c
-- warning: '= delete' with a message is incompatible with C++ standards before C++2c
-- 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: an attribute specifier sequence attached to a structured binding declaration is incompatible with C++ standards before C++2c
-- warning: an attribute specifier sequence attached to a structured binding declaration is incompatible with C++ standards before C++2c
-- 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: 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: pack indexing is incompatible with C++ standards before C++2c
-- warning: pack indexing is incompatible with C++ standards before C++2c
-- warning: placeholder variables are incompatible with C++ standards before C++2c
-- warning: placeholder variables are incompatible with C++ standards before C++2c
-- 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-c++2a-extensions
- clang-diagnostic-c++2a-extensions
-
- Diagnostic text:
-
-- 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: passing no argument for the '...' parameter of a variadic macro 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-c++2b-extensions
- clang-diagnostic-c++2b-extensions
-
- Diagnostic text:
-
-- 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
]]>
-
- INFO
-
-
- clang-diagnostic-c++2c-compat
- clang-diagnostic-c++2c-compat
-
- Diagnostic text:
-
-- warning: cannot delete expression with pointer-to-'void' type %0
-- warning: deleting pointer to incomplete type %0 is incompatible with C++2c and may cause undefined behavior
-
-References
-Diagnostic flags in Clang
]]>
-
- INFO
-
-
- clang-diagnostic-c++2c-extensions
- clang-diagnostic-c++2c-extensions
-
- Diagnostic text:
-
-- warning: '%0' in a raw string literal delimiter is a C++2c extension
-- warning: '= delete' with a message is a C++2c extension
-- warning: an attribute specifier sequence attached to a structured binding declaration is a C++2c extension
-- warning: pack indexing is a C++2c extension
-- warning: placeholder variables are a C++2c extension
-
-References
-Diagnostic flags in Clang
]]>
-
- INFO
-
clang-diagnostic-c++98-c++11-c++14-c++17-compat
clang-diagnostic-c++98-c++11-c++14-c++17-compat
@@ -32784,74 +32297,6 @@ Derived(); // and so temporary construction is okay
INFO
-
- clang-diagnostic-pre-c++2b-compat
- clang-diagnostic-pre-c++2b-compat
-
- 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
-
-References
-Diagnostic flags in Clang
]]>
-
- INFO
-
-
- clang-diagnostic-pre-c++2b-compat-pedantic
- clang-diagnostic-pre-c++2b-compat-pedantic
-
- 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
-
-References
-Diagnostic flags in Clang
]]>
-
- INFO
-
-
- clang-diagnostic-pre-c++2c-compat
- clang-diagnostic-pre-c++2c-compat
-
- Diagnostic text:
-
-- warning: '%0' in a raw string literal delimiter is incompatible with standards before C++2c
-- warning: '= delete' with a message is incompatible with C++ standards before C++2c
-- warning: an attribute specifier sequence attached to a structured binding declaration is incompatible with C++ standards before C++2c
-- warning: pack indexing is incompatible with C++ standards before C++2c
-- warning: placeholder variables are incompatible with C++ standards before C++2c
-
-References
-Diagnostic flags in Clang
]]>
-
- INFO
-
-
- clang-diagnostic-pre-c++2c-compat-pedantic
- clang-diagnostic-pre-c++2c-compat-pedantic
-
- Diagnostic text:
-
-- warning: '%0' in a raw string literal delimiter is incompatible with standards before C++2c
-- warning: '= delete' with a message is incompatible with C++ standards before C++2c
-- warning: an attribute specifier sequence attached to a structured binding declaration is incompatible with C++ standards before C++2c
-- warning: pack indexing is incompatible with C++ standards before C++2c
-- warning: placeholder variables are incompatible with C++ standards before C++2c
-
-References
-Diagnostic flags in Clang
]]>
-
- INFO
-
clang-diagnostic-pre-c11-compat
clang-diagnostic-pre-c11-compat
diff --git a/cxx-sensors/src/main/resources/rules.xsd b/cxx-sensors/src/main/resources/rules.xsd
index 7694fe346..b8caed80b 100644
--- a/cxx-sensors/src/main/resources/rules.xsd
+++ b/cxx-sensors/src/main/resources/rules.xsd
@@ -62,6 +62,20 @@
+
+
+
+
+
+
+
+
+
+
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 bb964af03..eb6fe8c6b 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(1572);
+ assertThat(repo.rules()).hasSize(1555);
}
}