Fixed "'Data' defined as a struct here but previously declared as a c…#4
Fixed "'Data' defined as a struct here but previously declared as a c…#4olegded wants to merge 1 commit into
Conversation
…lass" warning Fix for "'Data' defined as a struct here but previously declared as a class" shown on Mac using clang v 10.0.0 (clang-1000.11.45.5)
|
include/vsg/core/Data.h declares Data as a class, the DispatchTraversal.h header is correct. This means the PR introduces an error. The question has to be why you are getting a warning where there shouldn't be one. Could you codebase not be up to date? Could there be some form of namespace pollution going on? |
|
Ahhh... tracked it down to the DispatchTraversal.cpp declaring struct for the internal Data. The confusion over which Data is clear indication that I need to change the name of this internal class. I'll fix this. |
|
I was not quite sure which direction to change :-) |
|
The CppCoreGuidlines suggests use class for objects that has some invariant property that needs to be maintained, so in this case I think class is more appropriate as we shouldn't be willy nilly changing the how this object is managed. I have changed this internal data class to InternalData and made both the forward declare and definition to use class: |
…lass" warning
Fix for "'Data' defined as a struct here but previously declared as a class" shown on Mac using clang v 10.0.0 (clang-1000.11.45.5)
Description
While trying to compile and to run the prototype and the examples on Mac, I noticed the above mentioned warning (there are no other warnings/errors on Mac using clang v 10.0.0 so far).
Type of change
How Has This Been Tested?
Executed following tests using
bash:Test Configuration:
Checklist: