From e8f496bb6c77d29b241dcaed9d265472cec5f25e Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 17 May 2022 12:01:11 +0200 Subject: [PATCH] Fix a clang++15 warning * spot/parseaut/parseaut.yy: Move the try-block inside the code of the constructors, so that they can refer to non-static members. --- spot/parseaut/parseaut.yy | 52 ++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/spot/parseaut/parseaut.yy b/spot/parseaut/parseaut.yy index 1e3de6781..71ab8aaea 100644 --- a/spot/parseaut/parseaut.yy +++ b/spot/parseaut/parseaut.yy @@ -2618,45 +2618,51 @@ namespace spot { automaton_stream_parser::automaton_stream_parser(const std::string& name, automaton_parser_options opt) - try : filename_(name), opts_(opt) { - if (hoayyopen(name, &scanner_)) - throw std::runtime_error("Cannot open file "s + name); - } - catch (...) - { - hoayyclose(scanner_); - throw; + try + { + if (hoayyopen(name, &scanner_)) + throw std::runtime_error("Cannot open file "s + name); + } + catch (...) + { + hoayyclose(scanner_); + throw; + } } automaton_stream_parser::automaton_stream_parser(int fd, const std::string& name, automaton_parser_options opt) - try : filename_(name), opts_(opt) { - if (hoayyopen(fd, &scanner_)) - throw std::runtime_error("Cannot open file "s + name); - } - catch (...) - { - hoayyclose(scanner_); - throw; + try + { + if (hoayyopen(fd, &scanner_)) + throw std::runtime_error("Cannot open file "s + name); + } + catch (...) + { + hoayyclose(scanner_); + throw; + } } automaton_stream_parser::automaton_stream_parser(const char* data, const std::string& filename, automaton_parser_options opt) - try : filename_(filename), opts_(opt) { - hoayystring(data, &scanner_); - } - catch (...) - { - hoayyclose(scanner_); - throw; + try + { + hoayystring(data, &scanner_); + } + catch (...) + { + hoayyclose(scanner_); + throw; + } } automaton_stream_parser::~automaton_stream_parser()