public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type
@ 2012-02-22 18:49 trashyankes at wp dot pl
  2012-02-22 23:24 ` [Bug c++/52343] " daniel.kruegler at googlemail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: trashyankes at wp dot pl @ 2012-02-22 18:49 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52343
           Summary: [C++11] alias-definition dont work in
                    `template<class>` params type
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: trashyankes@wp.pl


gcc version 4.7.0 20120203 (experimental) (niXman build)

code:
---------------------------
---------------------------

class bb {};
template<typename A>
using a1 = int; //same with char, bool and long
template<typename C>
using a2 = bb;
template<typename D>
using a3 = double;

template<template<class> class T>
struct aa
{

};

aa<a1> zz1; //error: integral expression 'a1' is not constant WTF??
aa<a2> zz2;
aa<a3> zz3;

---------------------------
---------------------------


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

* [Bug c++/52343] [C++11] alias-definition dont work in `template<class>` params type
  2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
@ 2012-02-22 23:24 ` daniel.kruegler at googlemail dot com
  2012-02-23  9:54 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-02-22 23:24 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-02-22 22:31:40 UTC ---
Confirmed for 4.7.0 20120218 (experimental).

Reduced example:

//---
template<typename>
using A = int;

template<template<class> class>
struct B {};

B<A> b;
//---


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

* [Bug c++/52343] [C++11] alias-definition dont work in `template<class>` params type
  2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
  2012-02-22 23:24 ` [Bug c++/52343] " daniel.kruegler at googlemail dot com
@ 2012-02-23  9:54 ` redi at gcc dot gnu.org
  2012-11-06 20:54 ` cppljevans at suddenlink dot net
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-23  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-23
     Ever Confirmed|0                           |1


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

* [Bug c++/52343] [C++11] alias-definition dont work in `template<class>` params type
  2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
  2012-02-22 23:24 ` [Bug c++/52343] " daniel.kruegler at googlemail dot com
  2012-02-23  9:54 ` redi at gcc dot gnu.org
@ 2012-11-06 20:54 ` cppljevans at suddenlink dot net
  2012-11-06 20:55 ` cppljevans at suddenlink dot net
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cppljevans at suddenlink dot net @ 2012-11-06 20:54 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Larry Evans <cppljevans at suddenlink dot net> 2012-11-06 20:53:02 UTC ---
Created attachment 28625
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28625
test file


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

* [Bug c++/52343] [C++11] alias-definition dont work in `template<class>` params type
  2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
                   ` (2 preceding siblings ...)
  2012-11-06 20:54 ` cppljevans at suddenlink dot net
@ 2012-11-06 20:55 ` cppljevans at suddenlink dot net
  2012-12-20 15:25 ` dodji at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cppljevans at suddenlink dot net @ 2012-11-06 20:55 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Larry Evans <cppljevans at suddenlink dot net> 2012-11-06 20:55:19 UTC ---
Created attachment 28626
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28626
compilation of test file with 2 compilers and 2 values of macro.

The error is shown when -DUSE_ALIAS and with the later compiler, which
was created with release configuration.  The earlier compiler,
with debug configuration, doesn't show error.


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

* [Bug c++/52343] [C++11] alias-definition dont work in `template<class>` params type
  2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
                   ` (3 preceding siblings ...)
  2012-11-06 20:55 ` cppljevans at suddenlink dot net
@ 2012-12-20 15:25 ` dodji at gcc dot gnu.org
  2012-12-22 16:08 ` dodji at seketeli dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-12-20 15:25 UTC (permalink / raw)
  To: gcc-bugs


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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |dodji at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/52343] [C++11] alias-definition dont work in `template<class>` params type
  2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
                   ` (4 preceding siblings ...)
  2012-12-20 15:25 ` dodji at gcc dot gnu.org
@ 2012-12-22 16:08 ` dodji at seketeli dot org
  2013-01-07  8:04 ` dodji at gcc dot gnu.org
  2013-01-07 10:44 ` dodji at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at seketeli dot org @ 2012-12-22 16:08 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from dodji at seketeli dot org <dodji at seketeli dot org> 2012-12-22 16:08:25 UTC ---
A candidate patch for this was proposed at
http://gcc.gnu.org/ml/gcc-patches/2012-12/msg01312.html.


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

* [Bug c++/52343] [C++11] alias-definition dont work in `template<class>` params type
  2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
                   ` (5 preceding siblings ...)
  2012-12-22 16:08 ` dodji at seketeli dot org
@ 2013-01-07  8:04 ` dodji at gcc dot gnu.org
  2013-01-07 10:44 ` dodji at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at gcc dot gnu.org @ 2013-01-07  8:04 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Dodji Seketeli <dodji at gcc dot gnu.org> 2013-01-07 08:03:39 UTC ---
Author: dodji
Date: Mon Jan  7 08:03:33 2013
New Revision: 194960

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194960
Log:
PR c++/52343 - error with alias template as template template argument

In the example accompanying this patch, check_instantiated_arg tries
to ensure that a non-type template argument should be a constant if it
has integral or enumeration type.

The problem is that an alias template which type-id is, e.g, an
integer, looks like an argument that has integral/enumeration type:
its TREE_TYPE is an integer type.  So check_instantiated_arg
mistenkaly barks that this integral non-type argument is not a
constant.

Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.

gcc/cp/

    PR c++/52343
    * pt.c (check_instantiated_arg): Allow type template arguments.

gcc/testsuite/

    PR c++/52343
    * g++.dg/cpp0x/alias-decl-29.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-29.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/52343] [C++11] alias-definition dont work in `template<class>` params type
  2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
                   ` (6 preceding siblings ...)
  2013-01-07  8:04 ` dodji at gcc dot gnu.org
@ 2013-01-07 10:44 ` dodji at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at gcc dot gnu.org @ 2013-01-07 10:44 UTC (permalink / raw)
  To: gcc-bugs


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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

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

--- Comment #6 from Dodji Seketeli <dodji at gcc dot gnu.org> 2013-01-07 10:44:14 UTC ---
This should be fixed in trunk (4.8)


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

end of thread, other threads:[~2013-01-07 10:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22 18:49 [Bug c++/52343] New: [C++11] alias-definition dont work in `template<class>` params type trashyankes at wp dot pl
2012-02-22 23:24 ` [Bug c++/52343] " daniel.kruegler at googlemail dot com
2012-02-23  9:54 ` redi at gcc dot gnu.org
2012-11-06 20:54 ` cppljevans at suddenlink dot net
2012-11-06 20:55 ` cppljevans at suddenlink dot net
2012-12-20 15:25 ` dodji at gcc dot gnu.org
2012-12-22 16:08 ` dodji at seketeli dot org
2013-01-07  8:04 ` dodji at gcc dot gnu.org
2013-01-07 10:44 ` dodji at gcc dot gnu.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).