public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases
@ 2013-03-13 10:24 antoinep92 at gmail dot com
  2013-03-13 11:01 ` [Bug c++/56611] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: antoinep92 at gmail dot com @ 2013-03-13 10:24 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56611
           Summary: [C++11] Template instanciation failure with variadic
                    arguments and template aliases
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: antoinep92@gmail.com


The attached code fails to compile because of failed template instanciation /
type matching, but seems correct, compiles with clang, and can be made to
compile with gcc with minor modifications (see code comments).

Problem statement:
R<Func(int, int)> need result2<int, int> but the compiler does not seem able to
instanciate result2<int, int>. If result2<int, int> is explicitly instanciated,
the code compiles. Also if template alias result2 is replaced with a typedef in
a class (result1) the code compiles.
______________________

gcc 4.7.2 configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu


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

* [Bug c++/56611] [C++11] Template instanciation failure with variadic arguments and template aliases
  2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
@ 2013-03-13 11:01 ` redi at gcc dot gnu.org
  2013-03-13 11:09 ` antoinep92 at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2013-03-13 11:01 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2013-03-13
     Ever Confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-03-13 11:00:51 UTC ---
The attachment is missing.


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

* [Bug c++/56611] [C++11] Template instanciation failure with variadic arguments and template aliases
  2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
  2013-03-13 11:01 ` [Bug c++/56611] " redi at gcc dot gnu.org
@ 2013-03-13 11:09 ` antoinep92 at gmail dot com
  2013-03-13 11:13 ` [Bug c++/56611] [C++11] Template instantiation " antoinep92 at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: antoinep92 at gmail dot com @ 2013-03-13 11:09 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Antoine Poliakov <antoinep92 at gmail dot com> 2013-03-13 11:09:19 UTC ---
Created attachment 29662
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29662
g++ -std=c++11 -Wall -Wextra -c gcc-test.cpp


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

* [Bug c++/56611] [C++11] Template instantiation failure with variadic arguments and template aliases
  2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
  2013-03-13 11:01 ` [Bug c++/56611] " redi at gcc dot gnu.org
  2013-03-13 11:09 ` antoinep92 at gmail dot com
@ 2013-03-13 11:13 ` antoinep92 at gmail dot com
  2013-03-13 11:14 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: antoinep92 at gmail dot com @ 2013-03-13 11:13 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Antoine Poliakov <antoinep92 at gmail dot com> 2013-03-13 11:12:25 UTC ---
(In reply to comment #1)
> The attachment is missing.

Thanks! I got an error on first upload, but I thought it was ok - sorry.


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

* [Bug c++/56611] [C++11] Template instantiation failure with variadic arguments and template aliases
  2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
                   ` (2 preceding siblings ...)
  2013-03-13 11:13 ` [Bug c++/56611] [C++11] Template instantiation " antoinep92 at gmail dot com
@ 2013-03-13 11:14 ` paolo.carlini at oracle dot com
  2013-03-13 11:45 ` paolo at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-03-13 11:14 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-03-13 11:14:08 UTC ---
This works in mainline and isn't a regression. I guess we can add the testcase
to be safe and close the issue.


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

* [Bug c++/56611] [C++11] Template instantiation failure with variadic arguments and template aliases
  2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
                   ` (3 preceding siblings ...)
  2013-03-13 11:14 ` paolo.carlini at oracle dot com
@ 2013-03-13 11:45 ` paolo at gcc dot gnu.org
  2013-03-13 11:47 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo at gcc dot gnu.org @ 2013-03-13 11:45 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2013-03-13 11:44:47 UTC ---
Author: paolo
Date: Wed Mar 13 11:44:32 2013
New Revision: 196631

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196631
Log:
2013-03-13  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/56611
    * g++.dg/cpp0x/alias-decl-32.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-32.C
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/56611] [C++11] Template instantiation failure with variadic arguments and template aliases
  2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
                   ` (4 preceding siblings ...)
  2013-03-13 11:45 ` paolo at gcc dot gnu.org
@ 2013-03-13 11:47 ` paolo.carlini at oracle dot com
  2013-03-13 12:16 ` antoinep92 at gmail dot com
  2013-03-13 12:32 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-03-13 11:47 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.8.0
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-03-13 11:47:28 UTC ---
Done.


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

* [Bug c++/56611] [C++11] Template instantiation failure with variadic arguments and template aliases
  2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
                   ` (5 preceding siblings ...)
  2013-03-13 11:47 ` paolo.carlini at oracle dot com
@ 2013-03-13 12:16 ` antoinep92 at gmail dot com
  2013-03-13 12:32 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: antoinep92 at gmail dot com @ 2013-03-13 12:16 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Antoine Poliakov <antoinep92 at gmail dot com> 2013-03-13 12:15:30 UTC ---
Thanks. You can remove struct result1 (lines 11-15 in alias-decl-32.C) from the
test-case, it's not necessary (I would have done it but it's a very minor edit
and I don't have commit right).


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

* [Bug c++/56611] [C++11] Template instantiation failure with variadic arguments and template aliases
  2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
                   ` (6 preceding siblings ...)
  2013-03-13 12:16 ` antoinep92 at gmail dot com
@ 2013-03-13 12:32 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-03-13 12:32 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-03-13 12:31:38 UTC ---
Done, thanks (in the future, please void DOS-style CRs in the testcases)


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

end of thread, other threads:[~2013-03-13 12:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-13 10:24 [Bug c++/56611] New: [C++11] Template instanciation failure with variadic arguments and template aliases antoinep92 at gmail dot com
2013-03-13 11:01 ` [Bug c++/56611] " redi at gcc dot gnu.org
2013-03-13 11:09 ` antoinep92 at gmail dot com
2013-03-13 11:13 ` [Bug c++/56611] [C++11] Template instantiation " antoinep92 at gmail dot com
2013-03-13 11:14 ` paolo.carlini at oracle dot com
2013-03-13 11:45 ` paolo at gcc dot gnu.org
2013-03-13 11:47 ` paolo.carlini at oracle dot com
2013-03-13 12:16 ` antoinep92 at gmail dot com
2013-03-13 12:32 ` 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).