Skip to content
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

Fix Clang Template errors #1977

Merged

Conversation

dgovil
Copy link
Contributor

@dgovil dgovil commented Dec 3, 2024

Upcoming versions of Clang/LLVM change some behaviour around templating that causes OpenVDB to fail to compile.

This commit addresses two issues and allows VDB to compile again.

  1. There were three instances of an unnecessary template keyword in NodeManager.h that were not followed by a template call, and therefore are illegal to the compiler.

  2. GridBuilder.h had a template call to a non-existent method. This was not previously validated, but is now validated. Switching the call from isActive to isOn works (as suggested by Ken).

See the changelog for Clang and the associated PR for the second point above

This fixes #1976

Built on macOS with the following build args

-DBOOST_ROOT=/usr/local/apps/boost/1.82.0-a0
-DTBB_ROOT=/usr/local/apps/tbb/2020_U3-a1/platform-osx
-DBlosc_ROOT=/usr/local/apps/blosc/1.21.5-a0/apple_universal-2
-DOPENVDB_BUILD_NANOVDB=ON
-DNANOVDB_USE_OPENVDB=ON

Copy link
Contributor

@kmuseth kmuseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see request for minor change

nanovdb/nanovdb/tools/GridBuilder.h Show resolved Hide resolved
openvdb/openvdb/tree/NodeManager.h Show resolved Hide resolved
openvdb/openvdb/tree/NodeManager.h Show resolved Hide resolved
openvdb/openvdb/tree/NodeManager.h Show resolved Hide resolved
Upcoming versions of Clang/LLVM change some behaviour around templating that causes OpenVDB to fail to compile.

This commit addresses two issues and allows VDB to compile again.

1. There were three instances of an unnecessary template keyword in NodeManager.h that were not followed by a template call, and therefore are illegal to the compiler.

2. GridBuilder.h had a template call to a non-existent method. This was not previously validated, but is now validated. Switching the symbol from `isActive` to `isOn` per Ken's review.

See the [changelog](https://releases.llvm.org/19.1.0/tools/clang/docs/ReleaseNotes.html#improvements-to-clang-s-diagnostics:~:text=Clang%20now%20looks%20up%20members%20of%20the%20current%20instantiation%20in%20the%20template%20definition%20context%20if%20the%20current%20instantiation%20has%20no%20dependent%20base%20classes.) for Clang and the associated [PR for the second point above](llvm/llvm-project#84050)

Signed-off-by: Dhruv Govil <[email protected]>
@dgovil dgovil force-pushed the 1976-clang_template_fixes branch from 62c002c to e3ee850 Compare December 3, 2024 20:33
@mont29
Copy link

mont29 commented Dec 4, 2024

Can confirm that this PR fixes the issue I have when building Blender with clang19 on linux (reported as #1976).

@kmuseth kmuseth merged commit 930c3ac into AcademySoftwareFoundation:master Dec 5, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]Nanovdb: Invalid code in GridBuilder fails to compile with clang19
3 participants