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++/50870] New: [C++0x] ICE with decltype, operator->, and default template arguments


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

             Bug #: 50870
           Summary: [C++0x] ICE with decltype, operator->, and default
                    template arguments
    Classification: Unclassified
           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


This is a follow-up of bug 50864.

gcc 4.7.0 20111022 (experimental) with compiler option 

-std=c++0x -Wall

(with or without -pedantic) causes an ICE for the following code 

//---
struct impl {
  template <class T> static T create();
};

#define USE_CLASS

#ifdef USE_CLASS
template<class T, class U,
  class = decltype(impl::create<T>()->impl::create<U>()) // line 9
>
struct tester{};

tester<impl*, int> ti;
#else
template<class T, class U,
  class = decltype(impl::create<T>()->impl::create<U>()) // line 16
>
int test() { return 0; }

int i = test<impl*, int>();
#endif
//---

If USE_CLASS is defined:

"main.cpp|9|internal compiler error: Segmentation fault"

otherwise:

"main.cpp|16|internal compiler error: Segmentation fault"

Both code branches should be accepted.


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