GobySoft / dccl

Dynamic Compact Control Language
Other
17 stars 13 forks source link

Error when compiling with g++ v7.2.0 (Ubuntu 17.10/Artful Aardvark) #19

Closed MikeGodin closed 6 years ago

MikeGodin commented 6 years ago

The file codecs2/field_codec_default.h calls FieldCodecBase::use_required() three times, presumably referring to the base class in order to avoid a "no arguments that depend on a template parameter" error. However with g++ v7.2.0, the compiler interprets this reference to the base class as a call to a static method of the base class. This seems like a bug in the compiler, but it's also possible that this is an intentional change in g++.

Anyway, the relatively simple and backwards-compatible fix for codecs2/field_codec_default.h is to replace calls to FieldCodecBase::use_required() with this->use_required(), since use_required is not virtual and not hidden by a declaration in any other classes.

tsaubergine commented 6 years ago

Hmm, yeah I'd be interested to see if this is actually a change in the C++ standard. Go ahead a put up a pull request for the change.