public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52844] New: ICE
@ 2012-04-03 14:52 dave at boostpro dot com
  2012-04-03 15:06 ` [Bug c++/52844] ICE dave at boostpro dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: dave at boostpro dot com @ 2012-04-03 14:52 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52844
           Summary: ICE
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dave@boostpro.com


Created attachment 27076
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27076
Preprocessed source that triggers the bug

x.cpp: In substitution of 'template<class F, class ... T> decltype
(apply_tuple_(f, t, typename range_c<long unsigned int, 0ul, sizeof (T
...)>::type())) apply_tuple(F, const std::tuple<_Elements ...>&) [with F = int
(*)(int, int); T = {int, int}]':
x.cpp:99:47:   required from here
x.cpp:93:6: internal compiler error: in unify_one_argument, at cp/pt.c:15203
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
@ 2012-04-03 15:06 ` dave at boostpro dot com
  2012-10-12 15:06 ` paolo.carlini at oracle dot com
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dave at boostpro dot com @ 2012-04-03 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Dave Abrahams <dave at boostpro dot com> 2012-04-03 15:06:08 UTC ---
I think the problem is simple: missing initial type argument to vector_c in:


template <typename F, typename Tuple , std::size_t ...Is>
auto apply_tuple(F f, Tuple const & t, vector_c<Is...>)


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
  2012-04-03 15:06 ` [Bug c++/52844] ICE dave at boostpro dot com
@ 2012-10-12 15:06 ` paolo.carlini at oracle dot com
  2012-10-12 15:47 ` markus at trippelsdorf dot de
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-12 15:06 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-12 15:06:38 UTC ---
Dave, if we don't reduce the size of the testcase it will take a lot of time
for somebody to look into this. Do you have anything smaller? (creduce is
supposed to work pretty well)


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
  2012-04-03 15:06 ` [Bug c++/52844] ICE dave at boostpro dot com
  2012-10-12 15:06 ` paolo.carlini at oracle dot com
@ 2012-10-12 15:47 ` markus at trippelsdorf dot de
  2012-10-12 15:53 ` paolo.carlini at oracle dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: markus at trippelsdorf dot de @ 2012-10-12 15:47 UTC (permalink / raw)
  To: gcc-bugs


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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de

--- Comment #3 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-10-12 15:47:20 UTC ---
As Dave said the testcase is invalid:

Creduce comes up with:

markus@x4 tmp % cat test.ii
namespace std {
typedef int size_t;
template<typename>struct A;
}
struct B
{};
template<class T, T ...>struct vector_c
{
  typedef vector_c type;
};
template<class T, T, T>struct range_c : B
{};
template<class T, T start_finish>struct range_c<T, start_finish,
                                                start_finish>: vector_c<T>
{};
namespace std {
template<typename ...>class tuple;
template<typename ... _Elements>tuple<typename A<
                                        _Elements>::__type ...>make_tuple();
template<typename F, typename ... T, std::size_t ... Is>
  auto apply_tuple_(F, std::tuple<T ...>,
                    vector_c<Is ...>)->decltype(0);
template<typename F, typename ... T>
  auto apply_tuple(F, std::tuple<T ...>t)
  -> decltype(apply_tuple_ (0, t, typename range_c<std::size_t, 0,
                           sizeof ... (T)>::type()));
int x = apply_tuple(0, std::make_tuple);
}

markus@x4 tmp % g++ -std=c++11 -c test.ii
test.ii: In substitution of ‘template<class F, class ... T> decltype
(std::apply_tuple_(0, t, typename range_c<int, 0, sizeof (T ...)>::type()))
std::apply_tuple(F, std::tuple<T ...>) [with F = int; T = {}]’:
test.ii:27:39:   required from here
test.ii:26:51: internal compiler error: in unify_one_argument, at cp/pt.c:15162
                            sizeof ... (T)>::type()));
                                                   ^
Please submit a full bug report,


markus@x4 tmp % clang++ -std=c++11 -c test.ii
test.ii:22:30: error: template argument for template type parameter must be a
type
                    vector_c<Is ...>)->decltype(0);
                             ^~~~~~
test.ii:7:16: note: template parameter is declared here
template<class T, T ...>struct vector_c
               ^
test.ii:27:9: error: no matching function for call to 'apply_tuple'
int x = apply_tuple(0, std::make_tuple);
        ^~~~~~~~~~~
test.ii:24:8: note: candidate template ignored: substitution failure [with F =
int, T = <>]: no matching function for call to 'apply_tuple_'
  auto apply_tuple(F, std::tuple<T ...>t)
       ^
2 errors generated.


markus@x4 tmp % icpc -std=c++11 test.ii
test.ii(2): warning #910: declaration of "size_t" does not match the expected
type "unsigned long"
  typedef int size_t;
              ^

test.ii(22): error: constant "Is" is not a type name
                      vector_c<Is ...>)->decltype(0);
                               ^

test.ii(22): error: pack expansion does not make use of any argument packs
                      vector_c<Is ...>)->decltype(0);
                                  ^

test.ii(20): warning #2922: constant "Is" cannot be used because it follows a
parameter pack and cannot be deduced from the parameters of function template
"std::apply_tuple_"
  template<typename F, typename ... T, std::size_t ... Is>
                                                       ^

test.ii(27): error: no instance of function template "std::apply_tuple" matches
the argument list
            argument types are: (int, <unknown-type>)
  int x = apply_tuple(0, std::make_tuple);
          ^

compilation aborted for test.ii (code 2)


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (3 preceding siblings ...)
  2012-10-12 15:53 ` paolo.carlini at oracle dot com
@ 2012-10-12 15:53 ` glisse at gcc dot gnu.org
  2012-10-12 15:55 ` paolo.carlini at oracle dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-10-12 15:53 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> 2012-10-12 15:52:16 UTC ---
template < class > struct V { };
template < int... > struct tuple ;
template < int...Is > void f ( V < Is...>) { }
auto g ( ) -> decltype ( f ( V < long >  ( ) ) ) ;


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (2 preceding siblings ...)
  2012-10-12 15:47 ` markus at trippelsdorf dot de
@ 2012-10-12 15:53 ` paolo.carlini at oracle dot com
  2012-10-12 15:53 ` glisse at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-12 15:53 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-12 15:53:36 UTC ---
Thanks guys!


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (4 preceding siblings ...)
  2012-10-12 15:53 ` glisse at gcc dot gnu.org
@ 2012-10-12 15:55 ` paolo.carlini at oracle dot com
  2012-10-15  9:58 ` paolo.carlini at oracle dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-12 15:55 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-12
     Ever Confirmed|0                           |1


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (5 preceding siblings ...)
  2012-10-12 15:55 ` paolo.carlini at oracle dot com
@ 2012-10-15  9:58 ` paolo.carlini at oracle dot com
  2012-11-28 17:40 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-15  9:58 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-15 09:58:06 UTC ---
Of course this is also enough:

template < class > struct V { };
template < int...Is > void f ( V < Is...>) { }
auto g ( ) -> decltype ( f ( V < long >  ( ) ) ) ;

and decltype and the late specified return type aren't essential.


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (6 preceding siblings ...)
  2012-10-15  9:58 ` paolo.carlini at oracle dot com
@ 2012-11-28 17:40 ` paolo.carlini at oracle dot com
  2013-07-27 19:37 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-11-28 17:40 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jondreads at gmail dot com

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-28 17:39:32 UTC ---
*** Bug 55494 has been marked as a duplicate of this bug. ***


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (7 preceding siblings ...)
  2012-11-28 17:40 ` paolo.carlini at oracle dot com
@ 2013-07-27 19:37 ` paolo.carlini at oracle dot com
  2013-07-28  9:20 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-27 19:37 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lin90162 at gmail dot com

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 58004 has been marked as a duplicate of this bug. ***


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (8 preceding siblings ...)
  2013-07-27 19:37 ` paolo.carlini at oracle dot com
@ 2013-07-28  9:20 ` paolo.carlini at oracle dot com
  2014-04-10 12:03 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-28  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com

--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Looking into it.


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (9 preceding siblings ...)
  2013-07-28  9:20 ` paolo.carlini at oracle dot com
@ 2014-04-10 12:03 ` paolo.carlini at oracle dot com
  2014-04-10 14:07 ` paolo at gcc dot gnu.org
  2014-04-10 14:08 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-04-10 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0

--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Doesn't ICE anymore in mainline. I'm adding the testcase and closing the bug.


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (10 preceding siblings ...)
  2014-04-10 12:03 ` paolo.carlini at oracle dot com
@ 2014-04-10 14:07 ` paolo at gcc dot gnu.org
  2014-04-10 14:08 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-04-10 14:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Thu Apr 10 14:06:36 2014
New Revision: 209276

URL: http://gcc.gnu.org/viewcvs?rev=209276&root=gcc&view=rev
Log:
2014-04-10  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/52844
    * g++.dg/cpp0x/variadic156.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic156.C
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/52844] ICE
  2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
                   ` (11 preceding siblings ...)
  2014-04-10 14:07 ` paolo at gcc dot gnu.org
@ 2014-04-10 14:08 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-04-10 14:08 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org

--- Comment #12 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Done.


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

end of thread, other threads:[~2014-04-10 14:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-03 14:52 [Bug c++/52844] New: ICE dave at boostpro dot com
2012-04-03 15:06 ` [Bug c++/52844] ICE dave at boostpro dot com
2012-10-12 15:06 ` paolo.carlini at oracle dot com
2012-10-12 15:47 ` markus at trippelsdorf dot de
2012-10-12 15:53 ` paolo.carlini at oracle dot com
2012-10-12 15:53 ` glisse at gcc dot gnu.org
2012-10-12 15:55 ` paolo.carlini at oracle dot com
2012-10-15  9:58 ` paolo.carlini at oracle dot com
2012-11-28 17:40 ` paolo.carlini at oracle dot com
2013-07-27 19:37 ` paolo.carlini at oracle dot com
2013-07-28  9:20 ` paolo.carlini at oracle dot com
2014-04-10 12:03 ` paolo.carlini at oracle dot com
2014-04-10 14:07 ` paolo at gcc dot gnu.org
2014-04-10 14:08 ` paolo.carlini at oracle dot com

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).