AcademySoftwareFoundation / openvdb

OpenVDB - Sparse volume data structure and tools
http://www.openvdb.org/
Mozilla Public License 2.0
2.62k stars 647 forks source link

[BUILD] Clang-Cl fails to build due to RootNode.h ValueT aliasing #1785

Open bgottamd opened 5 months ago

bgottamd commented 5 months ago

Environment

Operating System: Windows 11 Version / Commit SHA: 45d2ce4 CMake Version: 3.28 Compiler: clang-cl

Describe the problem

When compiling with clang-cl the inner ValueT in the convertValue function reports an use of undeclared identifier ValueT error in RootNode.h

To Reproduce

The below example fails compile due to this issue. Boost may cause issues when compiling with clang but that can be fixed using this boost pull req.

#include <openvdb/openvdb.h>
#include <openvdb/tree/RootNode.h>
#include <openvdb/tree/InternalNode.h>
#include <iostream>

int main()
{
    openvdb::initialize();
    using FloatRootNodeType = openvdb::tree::RootNode<openvdb::tree::InternalNode<openvdb::tree::InternalNode<openvdb::tree::LeafNode<float, 3>, 4>, 5>>;
    FloatRootNodeType floatRoot;
    using IntRootNodeType = openvdb::tree::RootNode<openvdb::tree::InternalNode<openvdb::tree::InternalNode<openvdb::tree::LeafNode<int, 3>, 4>, 5>>;
    IntRootNodeType intRoot;
    openvdb::Coord xyz(0, 0, 0);
    intRoot = floatRoot;
    return 0;
}