cat is_constructible_bug.cc && g++-trunk -v -c -std=c++0x
is_constructible_bug.cc 
#include <type_traits>

class allocator_arg_t {};

class A {};

// From n3092: [allocator.uses.construction] 20.9.2.2 p1.2
//  (2nd part of condition, in FCD use case first part never true)
template <typename X, typename Alloc, typename... Args>
struct alloc_arg_1st : 
    std::is_constructible<X, ::allocator_arg_t, Alloc, Args...>
{
};

bool foo()
{
    struct B {};
    bool val = alloc_arg_1st<B, A>::value;// ok
    return val || alloc_arg_1st<int, A>::value; // bang
}
Using built-in specs.
COLLECT_GCC=/home/prak/Dev/gcc-install/bin/g++-trunk
COLLECT_LTO_WRAPPER=/home/prak/Dev/gcc-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc.git/configure --enable-languages=c,c++
--program-suffix=-trunk --prefix=/home/prak/Dev/gcc-install --disable-bootstrap
Thread model: posix
gcc version 4.6.0 20100716 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-c' '-std=c++0x' '-shared-libgcc' '-mtune=generic'
'-march=pentiumpro'
 /home/prak/Dev/gcc-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/cc1plus -quiet
-v -D_GNU_SOURCE is_constructible_bug.cc -quiet -dumpbase
is_constructible_bug.cc -mtune=generic -march=pentiumpro -auxbase
is_constructible_bug -std=c++0x -version -o /tmp/ccocsKE0.s
GNU C++ (GCC) version 4.6.0 20100716 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.3.4, GMP version 4.3.2, MPFR version 3.0.0,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0

/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/i686-pc-linux-gnu

/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/backward
 /home/prak/Dev/gcc-install/include
 /home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/include
 /home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/include-fixed
 /usr/include
End of search list.
GNU C++ (GCC) version 4.6.0 20100716 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.3.4, GMP version 4.3.2, MPFR version 3.0.0,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 6d1c47967936e3e68fa845533411d5d9
In file included from is_constructible_bug.cc:1:0:
/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/type_traits:
In instantiation of &#8216;const bool std::__is_constructible_helper<int,
allocator_arg_t, A>::__value&#8217;:
/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/type_traits:231:12:
  instantiated from &#8216;std::is_constructible<int, allocator_arg_t,
A>&#8217;
is_constructible_bug.cc:10:8:   instantiated from &#8216;alloc_arg_1st<int,
A>&#8217;
is_constructible_bug.cc:19:40:   instantiated from here
/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/type_traits:209:71:
error: expression list treated as compound expression in functional cast
[-fpermissive]


-- 
           Summary: [C++0x] <type_traits> std::is_constructible broken for
                    fundamental types.
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: piotr dot rak at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44969

Reply via email to