From 21732fce459911d4da0214baff52af7c8c48cc9f Mon Sep 17 00:00:00 2001 From: "Louis R. Marascio" Date: Wed, 1 Dec 2021 14:43:43 -0600 Subject: [PATCH] Resolve g++ warning: free-nonheap-object As described in issue #173, this warning is raised on various platforms and in various build types. For example, g++ 11 in release mode will cause this warning to be raised. This change fixes this warning. --- toml/parser.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toml/parser.hpp b/toml/parser.hpp index 62be405..7636f14 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -2134,7 +2134,7 @@ result parse_toml_file(location& loc) table_type data; // root object is also a table, but without [tablename] - if(auto tab = parse_ml_table(loc)) + if(const auto tab = parse_ml_table(loc)) { data = std::move(tab.unwrap()); }