public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44967]  New: [C++0x] decltype of method call dependand on pack expansion crashes
@ 2010-07-16 23:48 piotr dot rak at gmail dot com
  2010-07-16 23:49 ` [Bug c++/44967] " piotr dot rak at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: piotr dot rak at gmail dot com @ 2010-07-16 23:48 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3796 bytes --]

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

template<typename T1, typename T2, typename... Args>
struct has_construct
{
    typedef char one;
    typedef struct {char _m[2]; } two;

    template<typename U1, typename U2, typename... Args2>
    static decltype(std::declval<U1>().construct(std::declval<U2*>(),
std::declval<Args2>()...), one()) test(int);
    template<typename, typename, typename...>
    static two test(...);

    static const bool value = sizeof(test<T1, T2, Args...>(0)) == 1;
};


class A0
{};

class A1
{
    void construct(int*, int);
};

template<typename _Tp>
struct A2
{
  template<typename _Tp1, typename... _Args>
  void construct(_Tp1*, _Args&&...) {}
};


void foo()
{
    static bool a0 = has_construct<A0, int, int>::value; // ok
    static bool a1 = has_construct<A1, int, int>::value; // bang
    static bool a2 = has_construct<A2<int>, int>::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' '-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 has_construct.cc -quiet -dumpbase has_construct.cc
-mtune=generic -march=pentiumpro -auxbase has_construct -std=c++0x -version -o
/tmp/ccY4xmeE.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
has_construct.cc: In instantiation of &#8216;const bool has_construct<A1, int,
int>::value&#8217;:
has_construct.cc:37:51:   instantiated from here
has_construct.cc:14:67: internal compiler error: Naruszenie ochrony pamiêci
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Same with released 4.5.0


-- 
           Summary: [C++0x] decltype of method call dependand on pack
                    expansion crashes
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        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=44967


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-07-20 18:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-16 23:48 [Bug c++/44967] New: [C++0x] decltype of method call dependand on pack expansion crashes piotr dot rak at gmail dot com
2010-07-16 23:49 ` [Bug c++/44967] " piotr dot rak at gmail dot com
2010-07-17  0:21 ` paolo dot carlini at oracle dot com
2010-07-20 10:16 ` paolo dot carlini at oracle dot com
2010-07-20 13:52 ` [Bug c++/44967] [C++0x] decltype of method call dependent " jason at gcc dot gnu dot org
2010-07-20 17:34 ` jason at gcc dot gnu dot org
2010-07-20 18:23 ` jason at gcc dot gnu dot org
2010-07-20 18:23 ` jason at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).