Pass current access specifier to code generator
This commit is contained in:
parent
ad2d0f34f9
commit
0c4de49234
5 changed files with 251 additions and 168 deletions
|
|
@ -153,9 +153,13 @@ struct foo{
|
|||
using test_generator::test_generator;
|
||||
|
||||
private:
|
||||
generation_options do_get_options(const cpp_entity& e) override
|
||||
generation_options do_get_options(const cpp_entity& e,
|
||||
cpp_access_specifier_kind cur_access) override
|
||||
{
|
||||
if (e.name().front() == 'e')
|
||||
if (cur_access == cpp_protected)
|
||||
// exclude all protected
|
||||
return code_generator::exclude;
|
||||
else if (e.name().front() == 'e')
|
||||
// exclude all entities starting with `e`
|
||||
// add declaration flag to detect check for equality
|
||||
return code_generator::exclude | code_generator::declaration;
|
||||
|
|
@ -181,7 +185,7 @@ struct e_t {};
|
|||
|
||||
struct bar : e_t, base {};
|
||||
|
||||
class foo : e_t
|
||||
class foo : e_t, protected base
|
||||
{
|
||||
int a;
|
||||
|
||||
|
|
@ -191,6 +195,9 @@ public:
|
|||
private:
|
||||
int b;
|
||||
|
||||
protected:
|
||||
int p1;
|
||||
|
||||
public:
|
||||
int c;
|
||||
int e2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue