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.
This commit is contained in:
Alexandre Duret-Lutz 2022-05-17 12:01:11 +02:00
parent 3a234e24ae
commit e8f496bb6c

View file

@ -2618,8 +2618,9 @@ namespace spot
{
automaton_stream_parser::automaton_stream_parser(const std::string& name,
automaton_parser_options opt)
try
: filename_(name), opts_(opt)
{
try
{
if (hoayyopen(name, &scanner_))
throw std::runtime_error("Cannot open file "s + name);
@ -2629,12 +2630,14 @@ namespace spot
hoayyclose(scanner_);
throw;
}
}
automaton_stream_parser::automaton_stream_parser(int fd,
const std::string& name,
automaton_parser_options opt)
try
: filename_(name), opts_(opt)
{
try
{
if (hoayyopen(fd, &scanner_))
throw std::runtime_error("Cannot open file "s + name);
@ -2644,12 +2647,14 @@ namespace spot
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)
{
try
{
hoayystring(data, &scanner_);
}
@ -2658,6 +2663,7 @@ namespace spot
hoayyclose(scanner_);
throw;
}
}
automaton_stream_parser::~automaton_stream_parser()
{