diff --git a/test/gtest/helpers.cpp b/test/gtest/helpers.cpp index 199e3a374a3..5270d04e02a 100644 --- a/test/gtest/helpers.cpp +++ b/test/gtest/helpers.cpp @@ -154,7 +154,7 @@ namespace Test { const std::string &source, CompilerOptions::FrontendVersion langVersion /* = CompilerOptions::FrontendVersion::P4_16 */, - P4::ParseAnnotations parseAnnotations + const P4::ParseAnnotations &parseAnnotations /* = P4::ParseAnnotations() */) { auto *program = P4::parseP4String(source, langVersion); if (program == nullptr) { diff --git a/test/gtest/helpers.h b/test/gtest/helpers.h index debf2193936..a3efa4b0a0c 100644 --- a/test/gtest/helpers.h +++ b/test/gtest/helpers.h @@ -116,10 +116,10 @@ struct FrontendTestCase { /// Create a test case that only requires the frontend to run. static std::optional create( const std::string &source, CompilerOptions::FrontendVersion langVersion = defaultVersion, - P4::ParseAnnotations parseAnnotations = P4::ParseAnnotations()); + const P4::ParseAnnotations &parseAnnotations = P4::ParseAnnotations()); static std::optional create(const std::string &source, - P4::ParseAnnotations parseAnnotations) { + const P4::ParseAnnotations &parseAnnotations) { return create(source, defaultVersion, parseAnnotations); }