Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface Inheritance with C++ Headers #6

Open
quic-dperezzo opened this issue Feb 21, 2025 · 0 comments · May be fixed by #7
Open

Interface Inheritance with C++ Headers #6

quic-dperezzo opened this issue Feb 21, 2025 · 0 comments · May be fixed by #7

Comments

@quic-dperezzo
Copy link

When using inheritance in an IDL, idlc produces incorrect C++ headers for chained inheritance. Please see the below example.

// example/example.idl
interface A {
};

interface B: A {
};

interface C: B {
};

The compiled idl results in this class for interface C:

class IA {}; // base class
class IB : public IA {}; // B inherits from A
class IC : public IB IA {}; // C inherits from B(which inherits A) and A without a comma?

This gives the compiler error:

In file included from main.cpp:2:
./example.hpp:54:21: error: expected '{' after base class list
class IC : public IB IA {
                    ^

The compiled idl should return this instead.

class IA {}; // base class
class IB : public IA {}; // B inherits from A
class IC : public IB {}; // C inherits from B(which inherits A)

See this example:
inheritance.zip

@quic-jongyong quic-jongyong linked a pull request Feb 21, 2025 that will close this issue
@quic-nhaas quic-nhaas linked a pull request Feb 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant