public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template
@ 2004-11-13 21:01 reichelt at gcc dot gnu dot org
  2004-11-13 21:03 ` [Bug c++/18470] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-13 21:01 UTC (permalink / raw)
  To: gcc-bugs

The following valid code snippet is rejected by mainline:

========================================
template<typename> struct A
{
    static const int i=1;
};

template<typename T> struct B : A<T>
{
    using A<T>::i;
    char s[i];       // fails
    char t[A<T>::i]; // compiles
};
========================================

bug.cc:9: error: array bound is not an integer constant

Mark, I suspect your patch for PR 18429 is responsible for the regression.
Could you please have a look?

-- 
           Summary: [4.0 regression] array bound rejected as non-constant in
                    template
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: rejects-valid, monitored
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,mmitchel at gcc dot gnu
                    dot org


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


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

* [Bug c++/18470] [4.0 regression] array bound rejected as non-constant in template
  2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
@ 2004-11-13 21:03 ` pinskia at gcc dot gnu dot org
  2004-11-13 21:08 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-13 21:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-13 21:03 -------
This worked with 2004-11-12-161002 so it has to be recent.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

* [Bug c++/18470] [4.0 regression] array bound rejected as non-constant in template
  2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
  2004-11-13 21:03 ` [Bug c++/18470] " pinskia at gcc dot gnu dot org
@ 2004-11-13 21:08 ` pinskia at gcc dot gnu dot org
  2004-11-15 22:20 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-13 21:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-13 21:08 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-13 21:08:37
               date|                            |


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


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

* [Bug c++/18470] [4.0 regression] array bound rejected as non-constant in template
  2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
  2004-11-13 21:03 ` [Bug c++/18470] " pinskia at gcc dot gnu dot org
  2004-11-13 21:08 ` pinskia at gcc dot gnu dot org
@ 2004-11-15 22:20 ` mmitchel at gcc dot gnu dot org
  2004-11-24  5:06 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-15 22:20 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/18470] [4.0 regression] array bound rejected as non-constant in template
  2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-11-15 22:20 ` mmitchel at gcc dot gnu dot org
@ 2004-11-24  5:06 ` mmitchel at gcc dot gnu dot org
  2004-11-24 10:06 ` giovannibajo at libero dot it
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-24  5:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-11-24 05:06 -------
This is just another instance of the fact that G++ using-declarations are
actually ARM-style access declarations.  I would not expect this to be fixed in
G++ 4.0.x.

-- 


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


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

* [Bug c++/18470] [4.0 regression] array bound rejected as non-constant in template
  2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-11-24  5:06 ` mmitchel at gcc dot gnu dot org
@ 2004-11-24 10:06 ` giovannibajo at libero dot it
  2004-11-24 17:38 ` mark at codesourcery dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-24 10:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-11-24 10:05 -------
Yes, Mark, but it used to work just a few weeks ago, and it is a rejects-valid.

-- 


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


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

* [Bug c++/18470] [4.0 regression] array bound rejected as non-constant in template
  2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-11-24 10:06 ` giovannibajo at libero dot it
@ 2004-11-24 17:38 ` mark at codesourcery dot com
  2005-02-10  9:56 ` pinskia at gcc dot gnu dot org
  2005-02-10 10:06 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: mark at codesourcery dot com @ 2004-11-24 17:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mark at codesourcery dot com  2004-11-24 17:38 -------
Subject: Re:  [4.0 regression] array bound rejected as non-constant
 in template

giovannibajo at libero dot it wrote:
> ------- Additional Comments From giovannibajo at libero dot it  2004-11-24 10:05 -------
> Yes, Mark, but it used to work just a few weeks ago, and it is a rejects-valid.

I understand.  That's why I left the target for this PR set at 4.0.

We have an ever-growing list of these, with respect to using-declarations.

None of these have ever worked correctly; they've all worked because we 
made various mistakes in name lookup.  Every time we fix name lookup, we 
introduce more problems with using-declarations, because our 
using-declarations are not really using-declarations, but just access 
specifiers.  For example, we broke things in this area when we 
introduced two-phase name lookup.

The correct fix -- and, I suspect, the only correct fix -- is to 
implement using-declarations for classes correctly.  I'd love to do 
that, but depending on how big of a job it is, it may not happen for 4.0.



-- 


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


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

* [Bug c++/18470] [4.0 regression] array bound rejected as non-constant in template
  2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-11-24 17:38 ` mark at codesourcery dot com
@ 2005-02-10  9:56 ` pinskia at gcc dot gnu dot org
  2005-02-10 10:06 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-10  9:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-02-10 01:05 -------
Subject: Bug 18470

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2005-02-10 01:05:32

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: static12.C 

Log message:
	2005-02-09  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR c++/18470
	* g++.dg/template/static12.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5012&r2=1.5013
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static12.C.diff?cvsroot=gcc&r1=NONE&r2=1.1


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-10 01:05 -------
This was fixed by the patch which fixed PR 19826.
Closing as fixed, I already applied the testcase too.

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


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


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

* [Bug c++/18470] [4.0 regression] array bound rejected as non-constant in template
  2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-02-10  9:56 ` pinskia at gcc dot gnu dot org
@ 2005-02-10 10:06 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-10 10:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-02-10 01:05 -------
Subject: Bug 18470

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2005-02-10 01:05:32

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: static12.C 

Log message:
	2005-02-09  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR c++/18470
	* g++.dg/template/static12.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5012&r2=1.5013
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static12.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

end of thread, other threads:[~2005-02-10  1:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-13 21:01 [Bug c++/18470] New: [4.0 regression] array bound rejected as non-constant in template reichelt at gcc dot gnu dot org
2004-11-13 21:03 ` [Bug c++/18470] " pinskia at gcc dot gnu dot org
2004-11-13 21:08 ` pinskia at gcc dot gnu dot org
2004-11-15 22:20 ` mmitchel at gcc dot gnu dot org
2004-11-24  5:06 ` mmitchel at gcc dot gnu dot org
2004-11-24 10:06 ` giovannibajo at libero dot it
2004-11-24 17:38 ` mark at codesourcery dot com
2005-02-10  9:56 ` pinskia at gcc dot gnu dot org
2005-02-10 10:06 ` cvs-commit 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).