slycelote / caide-cpp-inliner

Transform a C++ program consisting of multiple source files and headers into a single self-contained source file without any external dependencies (except for standard system headers). Unused code is not included in the resulting file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unused fields are not removed

Predelnik opened this issue · comments

Header:

#pragma once
struct C { using type = int; };
struct D { C::type v; };

And use only class D in actual code.

That's very simplified example but obviously it leads to inability to use any sort of your own type trait in library code.

Does it only happen if the field v is unused?

Yeah it looks like assigning to v explicitly makes it work fine. Should this still work even if v is unused though because it doesn't get removed anyway?

This should be fixed now. (Although some unused fields still don't get removed, at least it won't cause compilation failure.)