From: Volodymyr Sapsai Date: Fri, 27 May 2022 21:05:12 +0000 (-0700) Subject: [ODRHash][NFC] Add missing 'select' case for `ODRMismatchDecl`. X-Git-Tag: upstream/15.0.7~6378 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3defc23488eb29c69d2a33c0c5b652c874fb0f3;p=platform%2Fupstream%2Fllvm.git [ODRHash][NFC] Add missing 'select' case for `ODRMismatchDecl`. No test changes because `err_module_odr_violation_mismatch_decl_unknown` is a catch-all when custom diagnostic is missing. And missing custom diagnostic we should fix by implementing it, not by improving the general case. But if we pass enum value not covered by 'select', clang can crash, so protect against that. Differential Revision: https://reviews.llvm.org/D126566 --- diff --git a/clang/include/clang/Basic/DiagnosticSerializationKinds.td b/clang/include/clang/Basic/DiagnosticSerializationKinds.td index 3fcdb61..33eba6c 100644 --- a/clang/include/clang/Basic/DiagnosticSerializationKinds.td +++ b/clang/include/clang/Basic/DiagnosticSerializationKinds.td @@ -375,12 +375,14 @@ def err_module_odr_violation_mismatch_decl_unknown : Error< "%q0 %select{with definition in module '%2'|defined here}1 has different " "definitions in different modules; first difference is this " "%select{||||static assert|field|method|type alias|typedef|data member|" - "friend declaration|unexpected decl}3">; + "friend declaration|function template|" + "unexpected decl}3">; def note_module_odr_violation_mismatch_decl_unknown : Note< "but in '%0' found " "%select{||||different static assert|different field|different method|" "different type alias|different typedef|different data member|" - "different friend declaration|another unexpected decl}1">; + "different friend declaration|different function template|" + "another unexpected decl}1">; def warn_duplicate_module_file_extension : Warning< "duplicate module file extension block name '%0'">,