Boost logo

Boost :

Subject: Re: [boost] Anyone have access to Sun Studio 12 compiler?
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2010-10-20 15:08:28


On Oct 20, 2010, at 9:49 AM, Lars Viklund wrote:
> On Wed, Oct 20, 2010 at 07:52:40AM -0700, Marshall Clow wrote:
>> I have a bug report on that compiler (Sparc, Solaris 9) that I don't have any way to reproduce.
>
> It is reproducable on one of the machines [1] I have access to at my
> university (Solaris 10, sparc, SunStudio 12) with the command line [2]
> and test program [3] shown below, producing the below errors [4], where
> :351 and :358 are the definitions of the free c_array functions of
> Boost.Array.
>
> [1] SunOS vega 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V240 Solaris
>
> [2] "CC" -library=stlport4 -xldscope=hidden -xO4 -mt -erroff=%none -KPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_MATH_TR1_DYN_LINK=1 -DNDEBUG -I"." -I"libs/math/src/tr1" -o 4757 4757.cc
>
> [3] // 4757.cc
> // ----8<----
> #include <boost/array.hpp>
> int main() {}
> // ----8<----

>
> [4]
> "./boost/array.hpp", line 351: Error: An integer constant expression is required within the array subscript operator.
> "./boost/array.hpp", line 358: Error: An integer constant expression is required within the array subscript operator.

Yeah - it's complaining about a method in boost::array:

    // Specific for boost::array: simply returns its elems data member.
    template <typename T, std::size_t N>
    T(&get_c_array(boost::array<T,N>& arg))[N]
    {
        return arg.elems;
    }

I don't see any subscript operators there at all. ;-)
I suspect that this is a limitation of the compiler.

Here's a standalone test case:

> #include <boost/array.hpp>
>
> int main(int argc, char *argv[])
> {
> boost::array<int,5> arr;
> return 0;
> }

-- Marshall


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk