From 3514131219ffdc94c0c61c5b585b53e97501fbea Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Wed, 29 Jun 2022 14:59:21 -0700 Subject: [PATCH] [ODRHash diagnostics] Fix typos. NFC. --- clang/include/clang/Basic/DiagnosticSerializationKinds.td | 2 +- clang/lib/Serialization/ASTReader.cpp | 14 +++++++------- clang/test/Modules/odr_hash.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSerializationKinds.td b/clang/include/clang/Basic/DiagnosticSerializationKinds.td index 33eba6c..251242e 100644 --- a/clang/include/clang/Basic/DiagnosticSerializationKinds.td +++ b/clang/include/clang/Basic/DiagnosticSerializationKinds.td @@ -355,7 +355,7 @@ def err_module_odr_violation_enum : Error< "enum with specified type %4|" "enum with %4 element%s4|" "%ordinal4 element has name %5|" - "%ordinal4 element %5 %select{has|does not have}6 an initilizer|" + "%ordinal4 element %5 %select{has|does not have}6 an initializer|" "%ordinal4 element %5 has an initializer|" "}3">; diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index f15e0bc..6bfd816 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -10636,7 +10636,7 @@ void ASTReader::diagnoseOdrViolations() { // Compare the hash generated to the hash stored. A difference means // that a body was present in the original source. Due to merging, - // the stardard way of detecting a body will not work. + // the standard way of detecting a body will not work. const bool HasFirstBody = ComputeCXXMethodODRHash(FirstMethod) != FirstMethod->getODRHash(); const bool HasSecondBody = @@ -11166,8 +11166,8 @@ void ASTReader::diagnoseOdrViolations() { DifferentSpecifiedTypes, DifferentNumberEnumConstants, EnumConstantName, - EnumConstantSingleInitilizer, - EnumConstantDifferentInitilizer, + EnumConstantSingleInitializer, + EnumConstantDifferentInitializer, }; // If we've already pointed out a specific problem with this enum, don't @@ -11301,18 +11301,18 @@ void ASTReader::diagnoseOdrViolations() { continue; if (!FirstInit || !SecondInit) { - ODRDiagError(FirstEnumConstant, EnumConstantSingleInitilizer) + ODRDiagError(FirstEnumConstant, EnumConstantSingleInitializer) << I + 1 << FirstEnumConstant << (FirstInit != nullptr); - ODRDiagNote(SecondEnumConstant, EnumConstantSingleInitilizer) + ODRDiagNote(SecondEnumConstant, EnumConstantSingleInitializer) << I + 1 << SecondEnumConstant << (SecondInit != nullptr); Diagnosed = true; break; } if (ComputeODRHash(FirstInit) != ComputeODRHash(SecondInit)) { - ODRDiagError(FirstEnumConstant, EnumConstantDifferentInitilizer) + ODRDiagError(FirstEnumConstant, EnumConstantDifferentInitializer) << I + 1 << FirstEnumConstant; - ODRDiagNote(SecondEnumConstant, EnumConstantDifferentInitilizer) + ODRDiagNote(SecondEnumConstant, EnumConstantDifferentInitializer) << I + 1 << SecondEnumConstant; Diagnosed = true; break; diff --git a/clang/test/Modules/odr_hash.cpp b/clang/test/Modules/odr_hash.cpp index 8189994..aed08c1 100644 --- a/clang/test/Modules/odr_hash.cpp +++ b/clang/test/Modules/odr_hash.cpp @@ -3300,7 +3300,7 @@ enum E7 { x71 = 0 }; enum E7 { x71 }; #else E7 e7; -// expected-error@second.h:* {{'Enums::E7' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st element 'x71' has an initilizer}} +// expected-error@second.h:* {{'Enums::E7' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st element 'x71' has an initializer}} // expected-note@first.h:* {{but in 'FirstModule' found 1st element 'x71' does not have an initializer}} #endif @@ -3310,7 +3310,7 @@ enum E8 { x81 }; enum E8 { x81 = 0 }; #else E8 e8; -// expected-error@second.h:* {{'Enums::E8' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st element 'x81' does not have an initilizer}} +// expected-error@second.h:* {{'Enums::E8' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st element 'x81' does not have an initializer}} // expected-note@first.h:* {{but in 'FirstModule' found 1st element 'x81' has an initializer}} #endif -- 2.7.4