This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50870] New: [C++0x] ICE with decltype, operator->, and default template arguments
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Oct 2011 19:16:06 +0000
- Subject: [Bug c++/50870] New: [C++0x] ICE with decltype, operator->, and default template arguments
- Auto-submitted: auto-generated
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.
- Follow-Ups:
- [Bug c++/50870] [C++0x] ICE with decltype, operator->, and default template arguments
- From: paolo.carlini at oracle dot com
- [Bug c++/50870] [C++0x] ICE with decltype, operator->, and default template arguments
- From: paolo at gcc dot gnu.org
- [Bug c++/50870] [C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and default template arguments
- From: paolo.carlini at oracle dot com
- [Bug c++/50870] [C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and default template arguments
- From: rguenth at gcc dot gnu.org
- [Bug c++/50870] [C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and default template arguments
- From: paolo.carlini at oracle dot com
- [Bug c++/50870] [C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and default template arguments
- From: hjl.tools at gmail dot com
- [Bug c++/50870] [C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and default template arguments
- From: paolo.carlini at oracle dot com
- [Bug c++/50870] [C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and default template arguments
- From: hjl.tools at gmail dot com
- [Bug c++/50870] [C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and default template arguments
- From: paolo.carlini at oracle dot com