diff --git a/include/cppast/code_generator.hpp b/include/cppast/code_generator.hpp index f4a4e1f..5f12e2e 100644 --- a/include/cppast/code_generator.hpp +++ b/include/cppast/code_generator.hpp @@ -370,23 +370,15 @@ namespace cppast return {}; } - /// \returns The generation options for that entity. - /// The base class version always returns no special options. - /// \notes This function will not be called if the one with the access specifier is overridden. - virtual generation_options do_get_options(const cpp_entity& e) - { - (void)e; - return {}; - } - /// \returns The generation options for that entity with the given access specifier. - /// If an entity is not part of a class, returns [cppast::cpp_public](). - /// The base class version forwards to the overload that doesn't take an access specifier. + /// If an entity is not part of a class the access specifier is alwasy [cppast::cpp_public](). + /// The base class version always returns no special options. virtual generation_options do_get_options(const cpp_entity& e, cppast::cpp_access_specifier_kind access) { + (void)e; (void)access; - return do_get_options(e); + return {}; } /// \effects Will be invoked before code of an entity is generated. diff --git a/test/test_parser.hpp b/test/test_parser.hpp index aa4cf0d..609588a 100644 --- a/test/test_parser.hpp +++ b/test/test_parser.hpp @@ -59,7 +59,8 @@ public: } private: - generation_options do_get_options(const cppast::cpp_entity&) override + generation_options do_get_options(const cppast::cpp_entity&, + cppast::cpp_access_specifier_kind) override { return options_; } diff --git a/tool/main.cpp b/tool/main.cpp index 2936ae2..9affd3d 100644 --- a/tool/main.cpp +++ b/tool/main.cpp @@ -79,7 +79,8 @@ void print_entity(std::ostream& out, const cppast::cpp_entity& e) private: // called to retrieve the generation options of an entity - generation_options do_get_options(const cppast::cpp_entity&) override + generation_options do_get_options(const cppast::cpp_entity&, + cppast::cpp_access_specifier_kind) override { // generate declaration only return code_generator::declaration;