Enable log macros to work with no args (#4475)

This is enabled by the C++20 __VA_OPT__ feature.
Uses of "{}" format string were updated.
Some warning suppressions were required for older clang versions.
Also improve codegen of wpi::Logger::Log(), frc::ReportError(), and frc::MakeError();
these generate better and less redundant code if they use fmt::string_view for the
format string instead of templating on it.
This commit is contained in:
Tyler Veness
2022-10-19 10:49:27 -07:00
committed by GitHub
parent 878cc8defb
commit 1fc098e696
70 changed files with 373 additions and 338 deletions

View File

@@ -39,10 +39,10 @@ Ultrasonic::Ultrasonic(DigitalOutput* pingChannel, DigitalInput* echoChannel)
m_echoChannel(echoChannel, wpi::NullDeleter<DigitalInput>()),
m_counter(m_echoChannel) {
if (!pingChannel) {
throw FRC_MakeError(err::NullParameter, "{}", "pingChannel");
throw FRC_MakeError(err::NullParameter, "pingChannel");
}
if (!echoChannel) {
throw FRC_MakeError(err::NullParameter, "{}", "echoChannel");
throw FRC_MakeError(err::NullParameter, "echoChannel");
}
Initialize();
}
@@ -86,7 +86,7 @@ int Ultrasonic::GetEchoChannel() const {
void Ultrasonic::Ping() {
if (m_automaticEnabled) {
throw FRC_MakeError(err::IncompatibleMode, "{}",
throw FRC_MakeError(err::IncompatibleMode,
"cannot call Ping() in automatic mode");
}