public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58734] New: [C++11] Template template parameter pack instantiation problem
@ 2013-10-15  8:07 roger.ferrer at bsc dot es
  2013-10-15  8:18 ` [Bug c++/58734] " paolo.carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: roger.ferrer at bsc dot es @ 2013-10-15  8:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58734
           Summary: [C++11] Template template parameter pack instantiation
                    problem
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roger.ferrer at bsc dot es

Hi,

this code fails to compile in g++ 4.9.0 20131015

// -- test.cc
template <typename R1, typename R2>
struct W1 { };

template <template <typename, typename> class W>
struct A { };

template <template <typename, typename> class ...W>
struct B { };

template <template <typename, typename> class ...W>
void f(A<W...> &a, B<W...> &b);

void g()
{
    A<W1> a;
    B<W1> b;

    ::f(a, b);
}
// -- end of test.cc

$ g++ -std=c++11 -c test.cc
test.cc: In instantiation of ‘void f(A<W ...>&, B<W ...>&) [with W = {W1}]’:

test.cc:18:6: internal compiler error: tree check: expected class ‘type’, have
‘declaration’ (template_decl) in write_CV_qualifiers_for_type, at
cp/mangle.c:2160
 void f(A<W...> &a, B<W...> &b);
      ^
0xcfa309 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
    ../../gcc-svn/gcc/tree.c:9351
0x6e3b43 tree_class_check
    ../../gcc-svn/gcc/tree.h:2797
0x6e3b43 write_CV_qualifiers_for_type
    ../../gcc-svn/gcc/cp/mangle.c:2160
0x6ed271 write_type
    ../../gcc-svn/gcc/cp/mangle.c:1893
0x6edd25 write_type
    ../../gcc-svn/gcc/cp/mangle.c:2065
0x6f16c8 write_template_args
    ../../gcc-svn/gcc/cp/mangle.c:2551
0x6e9adb write_name
    ../../gcc-svn/gcc/cp/mangle.c:821
0x6ed89b write_class_enum_type
    ../../gcc-svn/gcc/cp/mangle.c:2522
0x6ed89b write_type
    ../../gcc-svn/gcc/cp/mangle.c:1989
0x6edb85 write_type
    ../../gcc-svn/gcc/cp/mangle.c:2060
0x6ef2b7 write_method_parms
    ../../gcc-svn/gcc/cp/mangle.c:2509
0x6ef6ce write_bare_function_type
    ../../gcc-svn/gcc/cp/mangle.c:2451
0x6ea41d write_mangled_name
    ../../gcc-svn/gcc/cp/mangle.c:689
0x6f2dd5 mangle_decl_string
    ../../gcc-svn/gcc/cp/mangle.c:3446
0x6f3008 get_mangled_id
    ../../gcc-svn/gcc/cp/mangle.c:3468
0x6f3008 mangle_decl(tree_node*)
    ../../gcc-svn/gcc/cp/mangle.c:3491
0xcfbd80 decl_assembler_name(tree_node*)
    ../../gcc-svn/gcc/tree.c:582
0x7f4b44 insert_to_assembler_name_hash
    ../../gcc-svn/gcc/symtab.c:117
0x7f4ca1 symtab_initialize_asm_name_hash
    ../../gcc-svn/gcc/symtab.c:344
0x802628 analyze_functions
    ../../gcc-svn/gcc/cgraphunit.c:1109
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions

Kind regards,
>From gcc-bugs-return-431721-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 15 08:13:30 2013
Return-Path: <gcc-bugs-return-431721-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30749 invoked by alias); 15 Oct 2013 08:13:29 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 30698 invoked by uid 48); 15 Oct 2013 08:13:25 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/58731] wrong code (hangs) at -O3 on x86_64-linux-gnu
Date: Tue, 15 Oct 2013 08:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-58731-4-qsmEeQtUGS@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58731-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58731-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg00865.txt.bz2
Content-length: 950

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX731

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-10-15
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
int a, b, c, d, e;

int
main ()
{
  for (b = 4; b > -30; b--)
    for (; c;)
      for (;;)
    {
      e = a > 2147483647 - b;

the issue here is that PRE (and LIM) move 2147483647 - b outside the
for (;c;) loop entry test and thus make it always execute in the
outermost loop, triggering the undefined behavior at iteration 5.
Also warns at -O1 with -fstrict-overflow.

PR58134 and PR58227 are related (if not dups).


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

* [Bug c++/58734] [C++11] Template template parameter pack instantiation problem
  2013-10-15  8:07 [Bug c++/58734] New: [C++11] Template template parameter pack instantiation problem roger.ferrer at bsc dot es
@ 2013-10-15  8:18 ` paolo.carlini at oracle dot com
  2014-09-05 13:04 ` roger.ferrer at bsc dot es
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-10-15  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-10-15
     Ever confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Template template variadic parameters have some issues.


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

* [Bug c++/58734] [C++11] Template template parameter pack instantiation problem
  2013-10-15  8:07 [Bug c++/58734] New: [C++11] Template template parameter pack instantiation problem roger.ferrer at bsc dot es
  2013-10-15  8:18 ` [Bug c++/58734] " paolo.carlini at oracle dot com
@ 2014-09-05 13:04 ` roger.ferrer at bsc dot es
  2015-07-11 18:12 ` paolo.carlini at oracle dot com
  2015-07-11 18:18 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: roger.ferrer at bsc dot es @ 2014-09-05 13:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58734

--- Comment #2 from Roger Ferrer Ibanez <roger.ferrer at bsc dot es> ---
Hi,

g++ 4.9.1. does not fail anymore with this one. 

I guess it was already been fixed.

Kind regards,


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

* [Bug c++/58734] [C++11] Template template parameter pack instantiation problem
  2013-10-15  8:07 [Bug c++/58734] New: [C++11] Template template parameter pack instantiation problem roger.ferrer at bsc dot es
  2013-10-15  8:18 ` [Bug c++/58734] " paolo.carlini at oracle dot com
  2014-09-05 13:04 ` roger.ferrer at bsc dot es
@ 2015-07-11 18:12 ` paolo.carlini at oracle dot com
  2015-07-11 18:18 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-07-11 18:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58734

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
In fact the released 4.9.0 also doesn't fail. Let's the testcase and close the
bug.


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

* [Bug c++/58734] [C++11] Template template parameter pack instantiation problem
  2013-10-15  8:07 [Bug c++/58734] New: [C++11] Template template parameter pack instantiation problem roger.ferrer at bsc dot es
                   ` (2 preceding siblings ...)
  2015-07-11 18:12 ` paolo.carlini at oracle dot com
@ 2015-07-11 18:18 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-07-11 18:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58734

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

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


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

end of thread, other threads:[~2015-07-11 18:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-15  8:07 [Bug c++/58734] New: [C++11] Template template parameter pack instantiation problem roger.ferrer at bsc dot es
2013-10-15  8:18 ` [Bug c++/58734] " paolo.carlini at oracle dot com
2014-09-05 13:04 ` roger.ferrer at bsc dot es
2015-07-11 18:12 ` paolo.carlini at oracle dot com
2015-07-11 18:18 ` 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).