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

Ambiguous Template Specialization with Xtensor #91504

Open
jtramm opened this issue May 8, 2024 · 4 comments
Open

Ambiguous Template Specialization with Xtensor #91504

jtramm opened this issue May 8, 2024 · 4 comments
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" needs-reduction Large reproducer that should be reduced into a simpler form

Comments

@jtramm
Copy link

jtramm commented May 8, 2024

Sometime in the last month and a half or so, LLVM has broken for the C++ xtensor header library (https://github.com/xtensor-stack/xtensor).

I have a minimal reproducer, main.cpp:

#include "xtensor/xarray.hpp"

int main(void) {
  xt::xarray<double> temp;
  return 0;
}

compiled as:

clang++ main.cpp -I/path/to/xtensor/include -I/path/to/xtl/include

It works fine with llvm 18.1.0, and up to 1c683eb, but was broken somewhere between 1c683eb and 05f4448.

With the current develop version of LLVM, it gives the following error:

clang++ main.cpp -I/home/jtramm/openmc_offload/openmc/vendor/xtensor/include -I/home/jtramm/openmc_offload/openmc/vendor/xtl/include
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:19:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xbuffer_adaptor.hpp:21:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xstorage.hpp:23:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xtensor_simd.hpp:17:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xutils.hpp:896:31: error: ambiguous partial specializations of 'rebind_container<long, xt::svector<unsigned long>>'
  896 |         using type = typename rebind_container<std::ptrdiff_t, S>::type;
      |                               ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xutils.hpp:924:5: note: in instantiation of template class 'xt::get_strides_type<xt::svector<unsigned long>>' requested here
  924 |     using get_strides_t = typename get_strides_type<C>::type;
      |     ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:53:30: note: in instantiation of template type alias 'get_strides_t' requested here
   53 |         using strides_type = get_strides_t<shape_type>;
      |                              ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:36:43: note: in instantiation of template class 'xt::xcontainer_inner_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   36 |         using inner_shape_type = typename xcontainer_inner_types<D>::inner_shape_type;
      |                                           ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:64:11: note: in instantiation of template class 'xt::xcontainer_iterable_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   64 |         : xcontainer_iterable_types<xarray_container<EC, L, SC, Tag>>
      |           ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:43:43: note: in instantiation of template class 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   43 |         using inner_shape_type = typename iterable_types::inner_shape_type;
      |                                           ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:151:30: note: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)
  151 |     class xiterable : public xconst_iterable<D>
      |                              ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:311:42: note: in instantiation of template class 'xt::xiterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  311 |     class xcontiguous_iterable : private xiterable<D>
      |                                          ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:71:31: note: in instantiation of template class 'xt::xcontiguous_iterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   71 |     class xcontainer : public xcontiguous_iterable<D>,
      |                               ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  260 |     class xstrided_container : public xcontainer<D>
      |                                       ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   82 |     class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
      |                                     ^
main.cpp:4:22: note: in instantiation of template class 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
    4 |   xt::xarray<double> temp;
      |                      ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xutils.hpp:883:12: note: partial specialization matches [with X = long, C = xt::svector, T = unsigned long, N = 4]
  883 |     struct rebind_container<X, C<T, N>>
      |            ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xstorage.hpp:1415:12: note: partial specialization matches [with X = long, T = unsigned long, N = 4, A = std::allocator<unsigned long>, B = true]
 1415 |     struct rebind_container<X, svector<T, N, A, B>>
      |            ^
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:20:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:23:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:45:50: error: no type named 'stepper' in 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
   45 |         using stepper = typename iterable_types::stepper;
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:151:30: note: in instantiation of template class 'xt::xconst_iterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  151 |     class xiterable : public xconst_iterable<D>
      |                              ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:311:42: note: in instantiation of template class 'xt::xiterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  311 |     class xcontiguous_iterable : private xiterable<D>
      |                                          ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:71:31: note: in instantiation of template class 'xt::xcontiguous_iterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   71 |     class xcontainer : public xcontiguous_iterable<D>,
      |                               ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  260 |     class xstrided_container : public xcontainer<D>
      |                                       ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   82 |     class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
      |                                     ^
main.cpp:4:22: note: in instantiation of template class 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
    4 |   xt::xarray<double> temp;
      |                      ^
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:20:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:23:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:46:56: error: no type named 'const_stepper' in 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
   46 |         using const_stepper = typename iterable_types::const_stepper;
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:20:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:140:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  140 |         using accessible_base::at;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  260 |     class xstrided_container : public xcontainer<D>
      |                                       ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   82 |     class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
      |                                     ^
main.cpp:4:22: note: in instantiation of template class 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
    4 |   xt::xarray<double> temp;
      |                      ^
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:20:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:141:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  141 |         using accessible_base::shape;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:142:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  142 |         using accessible_base::operator[];
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:143:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  143 |         using accessible_base::back;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:144:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  144 |         using accessible_base::front;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:145:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  145 |         using accessible_base::in_bounds;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:146:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  146 |         using accessible_base::periodic;
      |               ^~~~~~~~~~~~~~~~~
In file included from main.cpp:1:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:93:52: error: no type named 'allocator_type' in 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
   93 |         using allocator_type = typename base_type::allocator_type;
      |                                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
main.cpp:4:22: note: in instantiation of template class 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
    4 |   xt::xarray<double> temp;
      |                      ^
In file included from main.cpp:1:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:102:54: error: no type named 'backstrides_type' in 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  102 |         using backstrides_type = typename base_type::backstrides_type;
      |                                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
12 errors generated.
make: *** [Makefile:2: all] Error 1

@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed new issue labels May 8, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented May 8, 2024

@llvm/issue-subscribers-clang-frontend

Author: John Tramm (jtramm)

Sometime in the last month and a half or so, LLVM has broken for the C++ xtensor header library (https://github.com/xtensor-stack/xtensor).

I have a minimal reproducer, main.cpp:

#include "xtensor/xarray.hpp"

int main(void) {
  xt::xarray&lt;double&gt; temp;
  return 0;
}

compiled as:

clang++ main.cpp -I/path/to/xtensor/include -I/path/to/xtl/include

It works fine with llvm 18.1.0, and up to 1c683eb, but was broken somewhere between 1c683eb and 05f4448.

With the current develop version of LLVM, it gives the following error:

clang++ main.cpp -I/home/jtramm/openmc_offload/openmc/vendor/xtensor/include -I/home/jtramm/openmc_offload/openmc/vendor/xtl/include
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:19:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xbuffer_adaptor.hpp:21:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xstorage.hpp:23:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xtensor_simd.hpp:17:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xutils.hpp:896:31: error: ambiguous partial specializations of 'rebind_container&lt;long, xt::svector&lt;unsigned long&gt;&gt;'
  896 |         using type = typename rebind_container&lt;std::ptrdiff_t, S&gt;::type;
      |                               ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xutils.hpp:924:5: note: in instantiation of template class 'xt::get_strides_type&lt;xt::svector&lt;unsigned long&gt;&gt;' requested here
  924 |     using get_strides_t = typename get_strides_type&lt;C&gt;::type;
      |     ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:53:30: note: in instantiation of template type alias 'get_strides_t' requested here
   53 |         using strides_type = get_strides_t&lt;shape_type&gt;;
      |                              ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:36:43: note: in instantiation of template class 'xt::xcontainer_inner_types&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
   36 |         using inner_shape_type = typename xcontainer_inner_types&lt;D&gt;::inner_shape_type;
      |                                           ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:64:11: note: in instantiation of template class 'xt::xcontainer_iterable_types&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
   64 |         : xcontainer_iterable_types&lt;xarray_container&lt;EC, L, SC, Tag&gt;&gt;
      |           ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:43:43: note: in instantiation of template class 'xt::xiterable_inner_types&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
   43 |         using inner_shape_type = typename iterable_types::inner_shape_type;
      |                                           ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:151:30: note: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)
  151 |     class xiterable : public xconst_iterable&lt;D&gt;
      |                              ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:311:42: note: in instantiation of template class 'xt::xiterable&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
  311 |     class xcontiguous_iterable : private xiterable&lt;D&gt;
      |                                          ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:71:31: note: in instantiation of template class 'xt::xcontiguous_iterable&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
   71 |     class xcontainer : public xcontiguous_iterable&lt;D&gt;,
      |                               ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
  260 |     class xstrided_container : public xcontainer&lt;D&gt;
      |                                       ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
   82 |     class xarray_container : public xstrided_container&lt;xarray_container&lt;EC, L, SC, Tag&gt;&gt;,
      |                                     ^
main.cpp:4:22: note: in instantiation of template class 'xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;' requested here
    4 |   xt::xarray&lt;double&gt; temp;
      |                      ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xutils.hpp:883:12: note: partial specialization matches [with X = long, C = xt::svector, T = unsigned long, N = 4]
  883 |     struct rebind_container&lt;X, C&lt;T, N&gt;&gt;
      |            ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xstorage.hpp:1415:12: note: partial specialization matches [with X = long, T = unsigned long, N = 4, A = std::allocator&lt;unsigned long&gt;, B = true]
 1415 |     struct rebind_container&lt;X, svector&lt;T, N, A, B&gt;&gt;
      |            ^
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:20:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:23:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:45:50: error: no type named 'stepper' in 'xt::xiterable_inner_types&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
   45 |         using stepper = typename iterable_types::stepper;
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:151:30: note: in instantiation of template class 'xt::xconst_iterable&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
  151 |     class xiterable : public xconst_iterable&lt;D&gt;
      |                              ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:311:42: note: in instantiation of template class 'xt::xiterable&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
  311 |     class xcontiguous_iterable : private xiterable&lt;D&gt;
      |                                          ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:71:31: note: in instantiation of template class 'xt::xcontiguous_iterable&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
   71 |     class xcontainer : public xcontiguous_iterable&lt;D&gt;,
      |                               ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
  260 |     class xstrided_container : public xcontainer&lt;D&gt;
      |                                       ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
   82 |     class xarray_container : public xstrided_container&lt;xarray_container&lt;EC, L, SC, Tag&gt;&gt;,
      |                                     ^
main.cpp:4:22: note: in instantiation of template class 'xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;' requested here
    4 |   xt::xarray&lt;double&gt; temp;
      |                      ^
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:20:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:23:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xiterable.hpp:46:56: error: no type named 'const_stepper' in 'xt::xiterable_inner_types&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
   46 |         using const_stepper = typename iterable_types::const_stepper;
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:20:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:140:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
  140 |         using accessible_base::at;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
  260 |     class xstrided_container : public xcontainer&lt;D&gt;
      |                                       ^
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;' requested here
   82 |     class xarray_container : public xstrided_container&lt;xarray_container&lt;EC, L, SC, Tag&gt;&gt;,
      |                                     ^
main.cpp:4:22: note: in instantiation of template class 'xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;' requested here
    4 |   xt::xarray&lt;double&gt; temp;
      |                      ^
In file included from main.cpp:1:
In file included from /home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:20:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:141:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
  141 |         using accessible_base::shape;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:142:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
  142 |         using accessible_base::operator[];
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:143:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
  143 |         using accessible_base::back;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:144:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
  144 |         using accessible_base::front;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:145:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
  145 |         using accessible_base::in_bounds;
      |               ^~~~~~~~~~~~~~~~~
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xcontainer.hpp:146:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
  146 |         using accessible_base::periodic;
      |               ^~~~~~~~~~~~~~~~~
In file included from main.cpp:1:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:93:52: error: no type named 'allocator_type' in 'xt::xstrided_container&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
   93 |         using allocator_type = typename base_type::allocator_type;
      |                                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
main.cpp:4:22: note: in instantiation of template class 'xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;' requested here
    4 |   xt::xarray&lt;double&gt; temp;
      |                      ^
In file included from main.cpp:1:
/home/jtramm/openmc_offload/openmc/vendor/xtensor/include/xtensor/xarray.hpp:102:54: error: no type named 'backstrides_type' in 'xt::xstrided_container&lt;xt::xarray_container&lt;xt::uvector&lt;double&gt;, xt::layout_type::row_major, xt::svector&lt;unsigned long&gt;&gt;&gt;'
  102 |         using backstrides_type = typename base_type::backstrides_type;
      |                                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
12 errors generated.
make: *** [Makefile:2: all] Error 1

@cor3ntin cor3ntin added the needs-reduction Large reproducer that should be reduced into a simpler form label May 9, 2024
@EthanLuisMcDonough
Copy link
Member

I've been encountering this issue as well. I've done some bisecting, and I think the breaking commit is b86e099.

@cor3ntin
Copy link
Contributor

cor3ntin commented May 9, 2024

@mizvekov

@mizvekov
Copy link
Contributor

mizvekov commented May 9, 2024

Already reported, see here: #89807 (comment)

Xtensor already includes workaround for template-template-args changes, but it tests for it in GCC specific way, instead of using standard feature testing macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" needs-reduction Large reproducer that should be reduced into a simpler form
Projects
None yet
Development

No branches or pull requests

6 participants