-
Notifications
You must be signed in to change notification settings - Fork 289
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
Test for dynamic_cast compiler bug #4015
base: devel
Are you sure you want to change the base?
Conversation
See issue 4014, or the URL in the comment.
I don't think the issue is specific to whether the virtual destructor is inlined or not, right?
The SO article doesn't include an example where the virtual destructor is declared out-of-line, but other virtual functions are still declared inline (the case we have with NumericVector), so I'm curious if the compiler would still have the bug in that case. If so, then moving the destructors out-of-line wouldn't change anything... |
BTW, there is at least one good reason to declare destructors out-of-line. If your class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good start, but I still think we should have a configure test (ideally not one based on executing test code, but based on static version checks of the OSX command line tools version) that sets libmesh_final
to an empty string when the bad version is detected.
In the petsc_vector.h header file, I tried the following potential solutions:
This suggests the issue with the compiler might have something to do specifically with the "final" keyword. |
See issue #4014.
I considered adding a workaround in another commit here, where we move all our defaulted virtual destructors into the .C files to try to convince the new XCode that that really is the proper place to create a single RTTI instantiation for each class. One downside would have been that this would prevent inlining of the destructors of
final
classes, but a bigger downside is that grep says we have 144 header files with defaulted virtual destructors that would need to be moved. Gross.