-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Apple: Fixes for stricter compiler parsing #3434
base: dev
Are you sure you want to change the base?
Conversation
…e even when the specific path is not taken during compilation. This fix removes on such unused path from SdfChildrenProxy in the assignment operator where there is no implementation of _Set
…te syntax, causing OpenUSD to fail to compile. `Sdf_Children<ChildPolicy>::_UpdateChildNames()` includes a template call that was in violation of ISO C standards to compile properly. ISO C++03 14.2/4: > When the name of a member template specialization appears after . or -> in a postfix-expression, or after nested-name-specifier in a qualified-id, and the postfix-expression or qualified-id explicitly depends on a template-parameter (14.6.2), the member template name must be prefixed by the keyword template. Otherwise the name is assumed to name a non-template. Explicitly adding the template keyword resolves this. Unfortunately this also gets tagged as unnecessary by older LLVM versions or other compilers, but c'est la vie.
Filed as internal issue #USD-10458 |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Just to confirm @dgovil -- You're saying that because
The change looks good to me, but I'm just making sure I understand which method was non-existent. |
@nvmkuruc Yes, pretty much. In older versions of the compiler, that path would never be taken and so the compiler never discovers that However, now it traverses paths that aren't used as a safety measure, and sees that there's no way to find |
Description of Change(s)
An upcoming Clang/LLVM version has stricter mandatory template checking that causes OpenUSD to fail to compile.
These are technically issues in the OpenUSD codebase that go against the C++ standard, but compilers have ignored them thus far. Therefore I am submitting them as fixes here.
We request that these please be part of the 25.2 release to prevent compilation issues for other developers.
The two issues:
Clang will check for template uses along uninitialized paths as well during compilation.
SdfChildrenProxy
had one such path, which had to be removed to allow compilation as it referenced a non existent method.Clang is being stricter about templated function calls in its parser.
Sdf_Children<ChildPolicy>::_UpdateChildNames()
used a method call that was in violation of the following ISO spec:ISO C++03 14.2/4:
Explicitly adding the template keyword resolves this. Unfortunately this also gets tagged as unnecessary by older LLVM versions or other compilers. However, a warning felt better than a compile failure.
Checklist
[X] I have created this PR based on the dev branch
[X] I have followed the coding conventions
[ ] I have added unit tests that exercise this functionality (Reference:
testing guidelines)
[X] I have verified that all unit tests pass with the proposed changes
[X] I have submitted a signed Contributor License Agreement (Reference:
Contributor License Agreement instructions)