r252861 - Use %select to merge two diagnostics that only differ in one word and are emitted in the same place. NFC
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 11 23:36:50 PST 2015
Author: ctopper
Date: Thu Nov 12 01:36:50 2015
New Revision: 252861
URL: http://llvm.org/viewvc/llvm-project?rev=252861&view=rev
Log:
Use %select to merge two diagnostics that only differ in one word and are emitted in the same place. NFC
Modified:
cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
cfe/trunk/lib/Lex/LiteralSupport.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=252861&r1=252860&r2=252861&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Thu Nov 12 01:36:50 2015
@@ -157,10 +157,8 @@ def ext_unknown_escape : ExtWarn<"unknow
def err_invalid_decimal_digit : Error<"invalid digit '%0' in decimal constant">;
def err_invalid_binary_digit : Error<"invalid digit '%0' in binary constant">;
def err_invalid_octal_digit : Error<"invalid digit '%0' in octal constant">;
-def err_invalid_suffix_integer_constant : Error<
- "invalid suffix '%0' on integer constant">;
-def err_invalid_suffix_float_constant : Error<
- "invalid suffix '%0' on floating constant">;
+def err_invalid_suffix_constant : Error<
+ "invalid suffix '%0' on %select{integer|floating}1 constant">;
def warn_cxx11_compat_digit_separator : Warning<
"digit separators are incompatible with C++ standards before C++14">,
InGroup<CXXPre14Compat>, DefaultIgnore;
Modified: cfe/trunk/lib/Lex/LiteralSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/LiteralSupport.cpp?rev=252861&r1=252860&r2=252861&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/lib/Lex/LiteralSupport.cpp Thu Nov 12 01:36:50 2015
@@ -680,9 +680,8 @@ NumericLiteralParser::NumericLiteralPars
// Report an error if there are any.
PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, SuffixBegin - ThisTokBegin),
- isFPConstant ? diag::err_invalid_suffix_float_constant :
- diag::err_invalid_suffix_integer_constant)
- << StringRef(SuffixBegin, ThisTokEnd-SuffixBegin);
+ diag::err_invalid_suffix_constant)
+ << StringRef(SuffixBegin, ThisTokEnd-SuffixBegin) << isFPConstant;
hadError = true;
return;
}
More information about the cfe-commits
mailing list