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

Intel Compiler Error: invalid partial specialization #31

Open
fsimonis opened this issue Sep 17, 2020 · 0 comments
Open

Intel Compiler Error: invalid partial specialization #31

fsimonis opened this issue Sep 17, 2020 · 0 comments

Comments

@fsimonis
Copy link

The following code fails to compile with the Intel Compiler icc (ICC) 2021.1 Beta 20200827:
gcc and clang compile this code without problems.

// ex.cpp
#include<iostream>
#include<vector>
#include<utility>

#include "prettyprint.hpp"

int main() {
  std::vector<std::pair<int, std::vector<int>>> v;
  std::cout << v << std::endl;
  return 1;
}

I ran the code using a docker container based on the official intel image intel/oneapi-hpckit.
The following is the slightly cleaned-up output of icc including the setup of the docker container.

> ls
ex.cpp
prettyprint.hpp

> docker run --rm -it -v$(pwd):/src:ro intel/oneapi-hpckit

# icc -I /src/ /src/ex.cpp 
/src/prettyprint.hpp(152): error: invalid partial specialization -- class "pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::printer<std::pair<int, std::vector<int, std::allocator<int>>>> [with T=std::vector<int, std::allocator<int>>, TChar=char, TCharTraits=std::char_traits<char>, TDelimiters=pretty_print::delimiters<std::vector<int, std::allocator<int>>, char>]" is already fully specialized
  struct print_container_helper<T, TChar, TCharTraits, TDelimiters>::printer<std::pair<T1, T2>> {
                                                                     ^
          detected during:
            instantiation of class "pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters> [with T=std::vector<int, std::allocator<int>>, TChar=char, TCharTraits=std::char_traits<char>, TDelimiters=pretty_print::delimiters<std::vector<int, std::allocator<int>>, char>]" at line 475
            instantiation of "std::enable_if<pretty_print::is_container<T>::value, std::basic_ostream<TChar, TCharTraits> &>::type std::operator<<(std::basic_ostream<TChar, TCharTraits> &, const T &) [with T=std::vector<int, std::allocator<int>>, TChar=char, TCharTraits=std::char_traits<char>]" at line 160

            instantiation of "void pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::printer<std::pair<T1, T2>>::print_body(const std::pair<T1, T2> &, pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::printer<std::pair<T1, T2>>::ostream_type &) [with T=std::pair<int, std::vector<int, std::allocator<int>>>, TChar=char, TCharTraits=std::char_traits<char>, TDelimiters=pretty_print::delimiters<std::pair<int, std::vector<int, std::allocator<int>>>, char>, T1=int, T2=std::vector<int, std::allocator<int>>]" at line 138
            instantiation of "void pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::operator()(pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::ostream_type &) const [with T=std::pair<int, std::vector<int, std::allocator<int>>>, TChar=char, TCharTraits=std::char_traits<char>, TDelimiters=pretty_print::delimiters<std::pair<int, std::vector<int, std::allocator<int>>>, char>]" at line 211
            instantiation of "std::basic_ostream<TChar, TCharTraits> &pretty_print::operator<<(std::basic_ostream<TChar, TCharTraits> &, const pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters> &) [with T=std::pair<int, std::vector<int, std::allocator<int>>>, TChar=char, TCharTraits=std::char_traits<char>, TDelimiters=pretty_print::delimiters<std::pair<int, std::vector<int, std::allocator<int>>>, char>]" at line 475
            instantiation of "std::enable_if<pretty_print::is_container<T>::value, std::basic_ostream<TChar, TCharTraits> &>::type std::operator<<(std::basic_ostream<TChar, TCharTraits> &, const T &) [with T=std::pair<int, std::vector<int, std::allocator<int>>>, TChar=char, TCharTraits=std::char_traits<char>]" at line 116

            instantiation of "void pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::printer<U>::print_body(const U &, pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::ostream_type &) [with T=std::vector<std::pair<int, std::vector<int, std::allocator<int>>>, std::allocator<std::pair<int, std::vector<int, std::allocator<int>>>>>, TChar=char, TCharTraits=std::char_traits<char>, TDelimiters=pretty_print::delimiters<std::vector<std::pair<int, std::vector<int, std::allocator<int>>>, std::allocator<std::pair<int, std::vector<int, std::allocator<int>>>>>, char>, U=std::vector<std::pair<int, std::vector<int, std::allocator<int>>>, std::allocator<std::pair<int, std::vector<int, std::allocator<int>>>>>]" at line 138
            instantiation of "void pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::operator()(pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters>::ostream_type &) const [with T=std::vector<std::pair<int, std::vector<int, std::allocator<int>>>, std::allocator<std::pair<int, std::vector<int, std::allocator<int>>>>>, TChar=char, TCharTraits=std::char_traits<char>, TDelimiters=pretty_print::delimiters<std::vector<std::pair<int, std::vector<int, std::allocator<int>>>, std::allocator<std::pair<int, std::vector<int, std::allocator<int>>>>>, char>]" at line 211
            instantiation of "std::basic_ostream<TChar, TCharTraits> &pretty_print::operator<<(std::basic_ostream<TChar, TCharTraits> &, const pretty_print::print_container_helper<T, TChar, TCharTraits, TDelimiters> &) [with T=std::vector<std::pair<int, std::vector<int, std::allocator<int>>>, std::allocator<std::pair<int, std::vector<int, std::allocator<int>>>>>, TChar=char, TCharTraits=std::char_traits<char>, TDelimiters=pretty_print::delimiters<std::vector<std::pair<int, std::vector<int, std::allocator<int>>>, std::allocator<std::pair<int, std::vector<int, std::allocator<int>>>>>, char>]" at line 475
            instantiation of "std::enable_if<pretty_print::is_container<T>::value, std::basic_ostream<TChar, TCharTraits> &>::type std::operator<<(std::basic_ostream<TChar, TCharTraits> &, const T &) [with T=std::vector<std::pair<int, std::vector<int, std::allocator<int>>>, std::allocator<std::pair<int, std::vector<int, std::allocator<int>>>>>, TChar=char, TCharTraits=std::char_traits<char>]" at line 9 of "/src/ex.cpp"

compilation aborted for /src/ex.cpp (code 2)
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

No branches or pull requests

1 participant