This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13998] New: regression compared to gcc3.3, breaks boost::is_array
- From: "john at johnmaddock dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Feb 2004 12:15:21 -0000
- Subject: [Bug c++/13998] New: regression compared to gcc3.3, breaks boost::is_array
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Our test code for boost::is_array is currently broken on gcc3.4, but working
on gcc3.3 as well as a variety of other compilers (VC7.1, Intel etc).
Test case follows,
Thanks,
John Maddock.
#include <cstddef>
namespace boost{
template <typename T>
struct is_array
{
static const bool value = false;
};
template <typename T, std::size_t N>
struct is_array<T[N]>
{
static const bool value = true;
};
template <typename T, std::size_t N>
struct is_array<const T[N]>
{
static const bool value = true;
};
template <typename T, std::size_t N>
struct is_array<volatile T[N]>
{
static const bool value = true;
};
template <typename T, std::size_t N>
struct is_array<const volatile T[N]>
{
static const bool value = true;
};
template <typename T>
struct is_array<T[]>
{
static const bool value = true;
};
template <typename T>
struct is_array<const T[]>
{
static const bool value = true;
};
template <typename T>
struct is_array<volatile T[]>
{
static const bool value = true;
};
template <typename T>
struct is_array<const volatile T[]>
{
static const bool value = true;
};
}
struct test{};
typedef int sa1[ ::boost::is_array<int>::value == 0 ? 1 : -1];
typedef int sa2[ ::boost::is_array<test>::value == 0? 1 : -1];
typedef int sa1[ ::boost::is_array<int[2]>::value ? 1 : -1];
typedef int sa1[ ::boost::is_array<int[]>::value ? 1 : -1];
typedef int sa1[ ::boost::is_array<int const[2]>::value ? 1 : -1];
typedef int sa1[ ::boost::is_array<int volatile[]>::value ? 1 : -1];
int main()
{
return 0;
}
--
Summary: regression compared to gcc3.3, breaks boost::is_array
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: john at johnmaddock dot co dot uk
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13998