From d7cc38062822b03d4d9b9cb790e23809fcff09e8 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 6 Jan 2025 18:26:17 -0800 Subject: [PATCH] ParmParse `queryAddWithParser` No Const (#4285) ## Summary `ParmParse::queryAddWithParser` might manipulate the internal state and should not be a const method. These parser functions might need a unit test in AMReX? ## Additional background First seen in https://github.com/ECP-WarpX/impactx/pull/743 ## Checklist The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate --- Src/Base/AMReX_ParmParse.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Base/AMReX_ParmParse.H b/Src/Base/AMReX_ParmParse.H index dc4fa07fb4e..73b3dbc107a 100644 --- a/Src/Base/AMReX_ParmParse.H +++ b/Src/Base/AMReX_ParmParse.H @@ -1117,7 +1117,7 @@ public: std::is_same_v || std::is_same_v || std::is_same_v,int> = 0> - int queryAddWithParser (const char* name, T& ref) const + int queryAddWithParser (const char* name, T& ref) { int exist = this->queryWithParser(name, ref); if (!exist) {