I would like GCC to issue a warning that VisualStudio generates when it finds a name that was declared with both class and struct . (Warning 4099) This usually occurs as a result of forward declarations, such as:
struct Base; ... class Base { ... };
VS doesn't actually bind in this case, so I raised the warning to an error. Since this project is cross-platform, I would also like to find this problem when compiling with GCC - otherwise I may accidentally check code that will not work in VS.
Is there any switch or method to let the GCC also reject or warn of class / structure declaration inconsistencies?
NOTE. It is not clear from the comments whether this warning is legal. For my question, this does not matter, since the condition leads to a communication failure in VisualStudio (I cannot just ignore the warning). So, I just wanted to identify problems using GCC, so my Windows compilations don't stop working.
ANSWER: It seems that there is no solution.
source share