[Trilinos-Users] [EXTERNAL] [12.2.1] compiler error with Teuchos on Clang

Denis Davydov davydden at gmail.com
Fri Sep 4 13:37:14 EDT 2015


Hi Mark,

Thanks for the prompt reply.

> On 4 Sep 2015, at 19:20, Hoemmen, Mark <mhoemme at sandia.gov> wrote:
> 
> 
> Thus, implementations of the Allocator concept need not have a max_size() method.  std::allocator_traits will fill in any optional methods.  Does the class not compile for you?

No, it does not compile on most recent Clang. 
Below is the copy from my original e-mail (13th of August):

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1594:25: error: no member named 'max_size' in 'Teuchos::Details::Allocator<int>'
           {return __a.max_size();}
                   ~~~ ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1491:17: note: in instantiation of member function 'std::__1::allocator_traits<Teuchos::Details::Allocator<int> >::__max_size' requested here
       {return __max_size(__has_max_size<const allocator_type>(), __a);}
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:934:50: note: in instantiation of member function 'std::__1::allocator_traits<Teuchos::Details::Allocator<int> >::max_size' requested here
   return _VSTD::min<size_type>(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2);  // end() >= begin(), always
                                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:911:15: note: in instantiation of member function 'std::__1::vector<int, Teuchos::Details::Allocator<int> >::max_size' requested here
   if (__n > max_size())
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:1070:9: note: in instantiation of member function 'std::__1::vector<int, Teuchos::Details::Allocator<int> >::allocate' requested here
       allocate(__n);
       ^
/Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/test/Allocator/Allocator.cpp:217:38: note: in instantiation of member function 'std::__1::vector<int, Teuchos::Details::Allocator<int> >::vector' requested here
   std::vector<int, int_alloc_type> intVec (numEntries);
                                    ^
In file included from /Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/test/Allocator/Allocator.cpp:42:
In file included from /Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/src/Teuchos_Details_Allocator.hpp:53:
In file included from /Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/src/Teuchos_ConfigDefs.hpp:85:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1594:25: error: no member named 'max_size' in 'Teuchos::Details::Allocator<double>'
           {return __a.max_size();}
                   ~~~ ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1491:17: note: in instantiation of member function 'std::__1::allocator_traits<Teuchos::Details::Allocator<double> >::__max_size' requested here
       {return __max_size(__has_max_size<const allocator_type>(), __a);}
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:934:50: note: in instantiation of member function 'std::__1::allocator_traits<Teuchos::Details::Allocator<double> >::max_size' requested here
   return _VSTD::min<size_type>(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2);  // end() >= begin(), always
                                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:911:15: note: in instantiation of member function 'std::__1::vector<double, Teuchos::Details::Allocator<double> >::max_size' requested here
   if (__n > max_size())
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:1070:9: note: in instantiation of member function 'std::__1::vector<double, Teuchos::Details::Allocator<double> >::allocate' requested here
       allocate(__n);
       ^
/Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/test/Allocator/Allocator.cpp:220:44: note: in instantiation of member function 'std::__1::vector<double, Teuchos::Details::Allocator<double> >::vector' requested here
   std::vector<double, double_alloc_type> dblVec (numEntries);
                                          ^
In file included from /Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/test/Allocator/Allocator.cpp:42:
In file included from /Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/src/Teuchos_Details_Allocator.hpp:53:
In file included from /Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/src/Teuchos_ConfigDefs.hpp:85:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1594:25: error: no member named 'max_size' in 'Teuchos::Details::Allocator<std::__1::basic_string<char> >'
           {return __a.max_size();}
                   ~~~ ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1491:17: note: in instantiation of member function 'std::__1::allocator_traits<Teuchos::Details::Allocator<std::__1::basic_string<char> > >::__max_size'
     requested here
       {return __max_size(__has_max_size<const allocator_type>(), __a);}
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:934:50: note: in instantiation of member function 'std::__1::allocator_traits<Teuchos::Details::Allocator<std::__1::basic_string<char> > >::max_size' requested
     here
   return _VSTD::min<size_type>(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2);  // end() >= begin(), always
                                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:911:15: note: in instantiation of member function 'std::__1::vector<std::__1::basic_string<char>, Teuchos::Details::Allocator<std::__1::basic_string<char> >
> ::max_size' requested here
   if (__n > max_size())
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:1070:9: note: in instantiation of member function 'std::__1::vector<std::__1::basic_string<char>, Teuchos::Details::Allocator<std::__1::basic_string<char> >
> ::allocate' requested here
       allocate(__n);
       ^
/Users/davydden/Downloads/trilinos-12.2.1-Source/packages/teuchos/core/test/Allocator/Allocator.cpp:269:49: note: in instantiation of member function 'std::__1::vector<std::__1::basic_string<char>, Teuchos::Details::Allocator<std::__1::basic_string<char> > >::vector'
     requested here
   std::vector<std::string, string_alloc_type> vec (numEntries);
                                               ^
3 errors generated.
make[2]: *** [packages/teuchos/core/test/Allocator/CMakeFiles/TeuchosCore_Allocator_UnitTest.dir/Allocator.cpp.o] Error 1
make[1]: *** [packages/teuchos/core/test/Allocator/CMakeFiles/TeuchosCore_Allocator_UnitTest.dir/all] Error 2
make: *** [all] Error 2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20150904/230d3bad/attachment.html>


More information about the Trilinos-Users mailing list