Skip to content

Commit c48c4a6

Browse files
committed
Switched to using multiclasses for both messages
1 parent dd97898 commit c48c4a6

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ defm constexpr_ctor_missing_init : CXX20Compat<
4949
defm adl_only_template_id : CXX20Compat<
5050
"use of function template name with no prior declaration in function call "
5151
"with explicit template arguments is">;
52+
defm ctad_for_alias_templates
53+
: CXX20Compat<"class template argument deduction for alias templates is">;
5254

5355
// C++23 compatibility with C++20 and earlier.
5456
defm constexpr_static_var : CXX23Compat<
@@ -8442,18 +8444,6 @@ let CategoryName = "Lambda Issue" in {
84428444
def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
84438445
"%select{default construction|assignment}0 of lambda is incompatible with "
84448446
"C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
8445-
8446-
// C++20 class template argument deduction for alias templates.
8447-
def warn_cxx17_compat_ctad_for_alias_templates
8448-
: Warning<"class template argument deduction for alias templates is "
8449-
"incompatible with "
8450-
"C++ standards before C++20">,
8451-
InGroup<CXXPre20Compat>,
8452-
DefaultIgnore;
8453-
def ext_ctad_for_alias_templates_cxx20
8454-
: ExtWarn<"class template argument deduction for alias templates is a "
8455-
"C++20 extension">,
8456-
InGroup<CXX20>;
84578447
}
84588448

84598449
def err_return_in_captured_stmt : Error<

clang/lib/Sema/SemaInit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9897,8 +9897,8 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer(
98979897
TemplateName.getAsTemplateDecl())) {
98989898
Diag(Kind.getLocation(),
98999899
getLangOpts().CPlusPlus20
9900-
? diag::warn_cxx17_compat_ctad_for_alias_templates
9901-
: diag::ext_ctad_for_alias_templates_cxx20);
9900+
? diag::compat_cxx20_ctad_for_alias_templates
9901+
: diag::compat_pre_cxx20_ctad_for_alias_templates);
99029902
LookupTemplateDecl = AliasTemplate;
99039903
auto UnderlyingType = AliasTemplate->getTemplatedDecl()
99049904
->getUnderlyingType()

0 commit comments

Comments
 (0)