https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101271
Bug ID: 101271 Summary: [12 Regression] error: ‘static constexpr decltype ... used before its definition Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: redi at gcc dot gnu.org Target Milestone: --- Created attachment 51090 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51090&action=edit test-case It's a recent regression. The test-case comes from blender package: $ g++ blender.ii -c In file included from /usr/include/openvdb/tree/LeafBuffer.h:10, from /usr/include/openvdb/tree/LeafNode.h:11, from /usr/include/openvdb/tree/Tree.h:18, from /usr/include/openvdb/Grid.h:12, from /usr/include/openvdb/openvdb.h:12, from /home/abuild/rpmbuild/BUILD/blender-2.92.0/extern/mantaflow/preprocessed/fileio/iovdb.cpp:31: /usr/include/tbb/atomic.h:21:141: note: ‘#pragma message: TBB Warning: tbb/atomic.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.’ In file included from /usr/include/openvdb/tools/PointPartitioner.h:26, from /usr/include/openvdb/tools/PointIndexGrid.h:19, from /usr/include/openvdb/points/PointConversion.h:15, from /home/abuild/rpmbuild/BUILD/blender-2.92.0/extern/mantaflow/preprocessed/fileio/iovdb.cpp:32: /usr/include/tbb/task_scheduler_init.h:21:154: note: ‘#pragma message: TBB Warning: tbb/task_scheduler_init.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.’ In file included from /usr/include/c++/12/memory:76, from /usr/include/tbb/tbb_stddef.h:452, from /usr/include/tbb/blocked_range3d.h:20, from /home/abuild/rpmbuild/BUILD/blender-2.92.0/extern/mantaflow/preprocessed/kernel.h:23, from /home/abuild/rpmbuild/BUILD/blender-2.92.0/extern/mantaflow/preprocessed/grid.h:26, from /home/abuild/rpmbuild/BUILD/blender-2.92.0/extern/mantaflow/preprocessed/fileio/iovdb.cpp:25: /usr/include/c++/12/bits/unique_ptr.h: In instantiation of ‘typename std::add_lvalue_reference<_Tp>::type std::unique_ptr<_Tp [], _Dp>::operator[](std::size_t) const [with _Tp = unsigned int; _Dp = std::default_delete<unsigned int []>; typename std::add_lvalue_reference<_Tp>::type = unsigned int&; std::size_t = long unsigned int]’: /usr/include/openvdb/tools/PointIndexGrid.h:447:20: required from here /usr/include/c++/12/bits/unique_ptr.h:672:55: error: ‘static constexpr decltype ((sizeof (_Elt) != 0)) std::unique_ptr<_Tp [], _Dp>::_S_nothrow_deref(std::size_t) [with _Ptr = unsigned int*; _Elt = unsigned int; _Tp = unsigned int; _Dp = std::default_delete<unsigned int []>; decltype ((sizeof (_Elt) != 0)) = bool; std::size_t = long unsigned int]’ used before its definition