This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/48745] New: [C++0x] Segmentation fault with list-initialization, void initializers and variadics


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

           Summary: [C++0x] Segmentation fault with list-initialization,
                    void initializers and variadics
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com
                CC: jason@redhat.com


The following code causes a segmentation fault with 4.7.0 20110422
(experimental) in C++0x mode at the line marked with #:

//--------------
template<class T>
struct add_rval_ref {
  typedef T&& type;
};

template<>
struct add_rval_ref<void> {
  typedef void type;
};

template<class T>
typename add_rval_ref<T>::type create();

template<class T, class... Args>
decltype(T{create<Args>()...}, char()) f(int);

template<class, class...>
char (&f(...))[2];

static_assert(sizeof(f<int, void>(0)) != 1, "Error"); // #
//--------------

"internal compiler error: Segmentation fault"

The code should be accepted.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]