Author: Luna Kirkby Date: 2021-08-06T07:09:16-04:00 New Revision: 6385abd0c4490e0516cb31c0b86c0fbcc052f815
URL: https://github.com/llvm/llvm-project/commit/6385abd0c4490e0516cb31c0b86c0fbcc052f815 DIFF: https://github.com/llvm/llvm-project/commit/6385abd0c4490e0516cb31c0b86c0fbcc052f815.diff LOG: Split 'qualifier on reference type has no effect' out into a new flag This introduces a new flag ignored-reference-qualifiers for the existing "'A' qualifier on reference type B has no effect" diagnostic, as a child of ignored-qualifiers. Rationale: This particular diagnostic is enabled by default, but other parts of ignored-qualifiers are not. Anecdotally, a user may encounter this diagnostic in the wild, and, seeing it to be valuable, might try to raise it to error with -Werror=ignored-qualifiers, whereupon the other diagnostics the flag covers will also be raised, to the user's surprise and confusion. By splitting this diagnostic out into a separate flag, and marking it as a child of ignored-qualifiers, we allow the user more granular control of the diagnostics they care about, while maintaining backwards compatibility with existing build scripts. Added: Modified: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td Removed: ################################################################################ diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 6857c889b72b6..1555a9ee24650 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -402,7 +402,8 @@ def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; def InfiniteRecursion : DiagGroup<"infinite-recursion">; def PureVirtualCallFromCtorDtor: DiagGroup<"call-to-pure-virtual-from-ctor-dtor">; def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">; -def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">; +def IgnoredReferenceQualifiers : DiagGroup<"ignored-reference-qualifiers">; +def IgnoredQualifiers : DiagGroup<"ignored-qualifiers", [IgnoredReferenceQualifiers]>; def : DiagGroup<"import">; def GNUIncludeNext : DiagGroup<"gnu-include-next">; def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">; diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 247f9d715b846..4ed561fb57b09 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -5735,7 +5735,7 @@ def warn_typecheck_function_qualifiers_unspecified : Warning< "'%0' qualifier on function type %1 has unspecified behavior">; def warn_typecheck_reference_qualifiers : Warning< "'%0' qualifier on reference type %1 has no effect">, - InGroup<IgnoredQualifiers>; + InGroup<IgnoredReferenceQualifiers>; def err_typecheck_invalid_restrict_not_pointer : Error< "restrict requires a pointer or reference (%0 is invalid)">; def err_typecheck_invalid_restrict_not_pointer_noarg : Error< _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits