public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32125] [4.3 regression] ICE with invalid specialization of variadic template
  2007-05-28 16:49 [Bug c++/32125] New: [4.3 regression] ICE with invalid specialization of variadic template reichelt at gcc dot gnu dot org
@ 2007-05-28 16:49 ` reichelt at gcc dot gnu dot org
  2007-05-28 16:53 ` reichelt at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-05-28 16:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


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


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

* [Bug c++/32125]  New: [4.3 regression] ICE with invalid specialization of variadic template
@ 2007-05-28 16:49 reichelt at gcc dot gnu dot org
  2007-05-28 16:49 ` [Bug c++/32125] " reichelt at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-05-28 16:49 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet triggers an ICE on mainline:

========================================================
template<typename...> struct A;

template<typename...T> struct A<T*>
{
  A();
  A(T);
};
========================================================

bug.cc:3: error: parameter packs not expanded with `...':
bug.cc:3: note:         'T'
bug.cc:4: error: parameter packs not expanded with `...':
bug.cc:4: note:         'T'
bug.cc:5: error: parameter packs not expanded with `...':
bug.cc:5: note:         'T'
bug.cc:6: error: parameter packs not expanded with `...':
bug.cc:6: note:         'T'
bug.cc:6: error: parameter packs not expanded with `...':
bug.cc:6: note:         'T'
bug.cc:6: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in add_method, at cp/class.c:1029
Please submit a full bug report, [etc.]

Just one nit: Do we have to emit an error message for every line
(sometimes even twice)?

Btw, the quotation should also be fixed like in the patch below
(I haven't time to test the patch, though):

=================================================================
--- gcc/gcc/cp/pt.c     2007-05-25 22:27:32 +0200
+++ gcc/gcc/cp/pt.c     2007-05-27 19:23:23 +0200
@@ -2622,7 +2622,7 @@ check_for_bare_parameter_packs (tree t)

   if (parameter_packs) 
     {
-      error ("parameter packs not expanded with `...':");
+      error ("parameter packs not expanded with %<...%>:");
       while (parameter_packs)
         {
           tree pack = TREE_VALUE (parameter_packs);
=================================================================


-- 
           Summary: [4.3 regression] ICE with invalid specialization of
                    variadic template
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/32125] [4.3 regression] ICE with invalid specialization of variadic template
  2007-05-28 16:49 [Bug c++/32125] New: [4.3 regression] ICE with invalid specialization of variadic template reichelt at gcc dot gnu dot org
  2007-05-28 16:49 ` [Bug c++/32125] " reichelt at gcc dot gnu dot org
@ 2007-05-28 16:53 ` reichelt at gcc dot gnu dot org
  2007-06-29 18:36 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-05-28 16:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from reichelt at gcc dot gnu dot org  2007-05-28 16:53 -------
A similar testcase crashes in a different place:

========================================================
template<typename...> struct A;

template<typename...T> struct A<T*>
{
  A() {}
};
========================================================

bug.cc:3: error: parameter packs not expanded with `...':
bug.cc:3: note:         'T'
bug.cc:4: error: parameter packs not expanded with `...':
bug.cc:4: note:         'T'
bug.cc:5: error: parameter packs not expanded with `...':
bug.cc:5: note:         'T'


Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report, [etc.]


-- 


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


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

* [Bug c++/32125] [4.3 regression] ICE with invalid specialization of variadic template
  2007-05-28 16:49 [Bug c++/32125] New: [4.3 regression] ICE with invalid specialization of variadic template reichelt at gcc dot gnu dot org
  2007-05-28 16:49 ` [Bug c++/32125] " reichelt at gcc dot gnu dot org
  2007-05-28 16:53 ` reichelt at gcc dot gnu dot org
@ 2007-06-29 18:36 ` mmitchel at gcc dot gnu dot org
  2007-10-01 19:16 ` pcarlini at suse dot de
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-06-29 18:36 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


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


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

* [Bug c++/32125] [4.3 regression] ICE with invalid specialization of variadic template
  2007-05-28 16:49 [Bug c++/32125] New: [4.3 regression] ICE with invalid specialization of variadic template reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-06-29 18:36 ` mmitchel at gcc dot gnu dot org
@ 2007-10-01 19:16 ` pcarlini at suse dot de
  2007-10-26 22:26 ` pcarlini at suse dot de
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2007-10-01 19:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pcarlini at suse dot de  2007-10-01 19:15 -------
On it.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pcarlini at suse dot de
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-01 19:15:42
               date|                            |


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


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

* [Bug c++/32125] [4.3 regression] ICE with invalid specialization of variadic template
  2007-05-28 16:49 [Bug c++/32125] New: [4.3 regression] ICE with invalid specialization of variadic template reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-10-01 19:16 ` pcarlini at suse dot de
@ 2007-10-26 22:26 ` pcarlini at suse dot de
  2007-11-06 14:39 ` dgregor at gcc dot gnu dot org
  2007-11-06 14:43 ` dgregor at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2007-10-26 22:26 UTC (permalink / raw)
  To: gcc-bugs



-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|pcarlini at suse dot de     |unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug c++/32125] [4.3 regression] ICE with invalid specialization of variadic template
  2007-05-28 16:49 [Bug c++/32125] New: [4.3 regression] ICE with invalid specialization of variadic template reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-10-26 22:26 ` pcarlini at suse dot de
@ 2007-11-06 14:39 ` dgregor at gcc dot gnu dot org
  2007-11-06 14:43 ` dgregor at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: dgregor at gcc dot gnu dot org @ 2007-11-06 14:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dgregor at gcc dot gnu dot org  2007-11-06 14:38 -------
Subject: Bug 32125

Author: dgregor
Date: Tue Nov  6 14:37:56 2007
New Revision: 129928

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129928
Log:
2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>

        PR c++/31439
        PR c++/32114
        PR c++/32115
        PR c++/32125
        PR c++/32126
        PR c++/32127
        PR c++/32128
        PR c++/32253
        PR c++/32566
        * typeck.c (check_return_expr): Pass address of retval to
        check_for_bare_parameter_packs.
        * class.c (build_base_field): Tolerate bases that have no layout
        due to errors.
        (end_of_base): Ditto.
        * tree.c (canonical_type_variant): Be careful with
        ERROR_MARK_NODE.
        * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
        tree*.
        * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
        which states whether parameter packs should be replaced with
        ERROR_MARK_NODE.
        (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
        possible. If set_packs_to_error is set true, replace the parameter
        pack with ERROR_MARK_NODE. Manage our own pointer sets.
        (uses_parameter_packs): Don't set parameter packs to
        ERROR_MARK_NODE.
        (check_for_bare_parameter_packs): Now takes a pointer to a tree,
        which may be modified (if it is a parameter pack). Instructs
        find_parameter_packs_r to replace parameter packs with
        ERROR_MARK_NODE (so that they won't cause errors later on).
        (process_template_parm): Pass pointer to
        check_for_bare_parameter_packs.
        (process_partial_specialization): Replace pack expansions before
        the end of the template argument list with ERROR_MARK_NODE.
        (push_template_decl_real): Pass pointer to
        check_for_bare_parameter_packs. Replace parameter packs not at the
        end of the template parameter list with ERROR_MARK_NODE.
        (convert_template_argument): Be more careful about using DECL_NAME
        on only declarations.
        (unify): Can't unify against ERROR_MARK_NODE.
        * semantics.c (finish_cond): Pass pointer to
        check_for_bare_parameter_packs.
        (finish_expr_stmt): Ditto.
        (finish_for_expr): Ditto.
        (finish_switch_cond): Pass pointer to
        check_for_bare_parameter_packs, and call it before we put the
        condition into the statement.
        (finish_mem_initializers): Pass pointer to
        check_for_bare_parameter_packs.
        (finish_member_declaration): Ditto.
        * parser.c (cp_parser_base_clause): Ditto.

2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>

        * testsuite/g++.dg/parser/crash36.C: Tweak expected errors.
        * testsuite/g++.dg/cpp0x/pr31439.C: New.
        * testsuite/g++.dg/cpp0x/pr32114.C: New.
        * testsuite/g++.dg/cpp0x/pr32115.C: New.
        * testsuite/g++.dg/cpp0x/pr32125.C: New.
        * testsuite/g++.dg/cpp0x/pr32126.C: New.
        * testsuite/g++.dg/cpp0x/pr32127.C: New.
        * testsuite/g++.dg/cpp0x/pr32128.C: New.
        * testsuite/g++.dg/cpp0x/pr32253.C: New.
        * testsuite/g++.dg/cpp0x/pr32566.C: New.
        * testsuite/g++.dg/cpp0x/pr31445.C: Tweak expected errors.
        * testsuite/g++.dg/cpp0x/pr31438.C: Ditto.
        * testsuite/g++.dg/cpp0x/variadic81.C: Ditto.
        * testsuite/g++.dg/cpp0x/pr31432.C: Ditto.
        * testsuite/g++.dg/cpp0x/pr31442.C: Ditto.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr31439.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32114.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32115.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32125.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32126.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32127.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32128.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32253.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32566.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/tree.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/pr31432.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr31438.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr31442.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr31445.C
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic81.C
    trunk/gcc/testsuite/g++.dg/parse/crash36.C


-- 


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


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

* [Bug c++/32125] [4.3 regression] ICE with invalid specialization of variadic template
  2007-05-28 16:49 [Bug c++/32125] New: [4.3 regression] ICE with invalid specialization of variadic template reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-11-06 14:39 ` dgregor at gcc dot gnu dot org
@ 2007-11-06 14:43 ` dgregor at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: dgregor at gcc dot gnu dot org @ 2007-11-06 14:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dgregor at gcc dot gnu dot org  2007-11-06 14:43 -------
Fixed


-- 

dgregor at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2007-11-06 14:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-28 16:49 [Bug c++/32125] New: [4.3 regression] ICE with invalid specialization of variadic template reichelt at gcc dot gnu dot org
2007-05-28 16:49 ` [Bug c++/32125] " reichelt at gcc dot gnu dot org
2007-05-28 16:53 ` reichelt at gcc dot gnu dot org
2007-06-29 18:36 ` mmitchel at gcc dot gnu dot org
2007-10-01 19:16 ` pcarlini at suse dot de
2007-10-26 22:26 ` pcarlini at suse dot de
2007-11-06 14:39 ` dgregor at gcc dot gnu dot org
2007-11-06 14:43 ` dgregor 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).