2 Replies Latest reply on Jul 30, 2014 5:19 PM by Fedor-Oracle

    Error compiling certain uses of std::tuple in Solaris Studio 12.4 beta July refresh


      Whilst attempting to compile Boost 1.54 using the Solaris Studio 12.4 beta July refresh with -std=c++11 I get an error building libs/regex/src/cregex.cpp that looks like it might be due to a problem with the compiler.  (clang++ on Mac OS X and g++ on Linux can certainly build the same file without problems - I can post more details about them if you think this is a problem in the Boost code rather than the compiler.)


      The error from Solaris Studio is:


      Error: Could not find a match for std::_Tuple_impl<0, int&&>::_Tuple_impl(std::tuple<int&&>, int) needed in std::tuple<int&&>::tuple<int, void>(int&&).

      "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/tuple", line 868:     Where: While instantiating "std::tuple<int&&>::tuple<int, void>(int&&)".

      "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/tuple", line 868:     Where: Instantiated from std::forward_as_tuple<int>(int&&).

      "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_map.h", line 485:     Where: Instantiated from non-template code.

      1 Error(s) detected.


      To reproduce this you can download the pre-processed source code from http://pastebin.com/jtsx1k79 and paste it into a file called cregex.pre.cpp.  Then run:


      CC -std=c++11 -mt -m64 -c -o cregex.o cregex.pre.cpp


      to get the error I saw.


      In case it's relevant, I'm working on Oracle Solaris 10 1/13 s10x_u11wos_24a X86.