public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
@ 2005-10-10 16:31 ` reichelt at gcc dot gnu dot org
  2005-10-18  6:28 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-10-10 16:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2005-10-10 16:31 -------
On the 3.4 branch the situation changed with Giovanni's patch for PR19208:
http://gcc.gnu.org/ml/gcc-cvs/2005-07/msg00902.html

We now diagnose none of the arrays without "-pedantic", and all three
arrays with "-pedantic". This matches the behavior for arrays in
non-template structs and outside any struct. So I'd call this fixed on
the 3.4 branch.

The 4.0 branch and mainline still have the problem, though.
Technically these are regressions now.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Inconsistency with zero-    |[4.0/4.1 regression]
                   |sized arrays                |Inconsistency with zero-
                   |                            |sized arrays
   Target Milestone|---                         |4.0.3


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
  2005-10-10 16:31 ` [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays reichelt at gcc dot gnu dot org
@ 2005-10-18  6:28 ` mmitchel at gcc dot gnu dot org
  2005-10-27 20:39 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-18  6:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2005-10-18 06:28 -------
We all agree that in pedantic mode all three lines are erroneous, so let's just
consider the non-pedantic case.  

We can choose not to be picky about the non-dependent declarations because such
code makes the program ill-formed; accepting such a program clearly does not
change the behavior of any conforming program.

But, for dependent declarations, we must be careful of SFINAE.  If we do not
reject instantiations that create types where type deduction fails, we can
change the meaning of conforming programs -- and the absence of -pedantic
should never change the meaning of a conforming program.  So, we must issue an
error for the dependent cases.

I think that the right fix for this is to make the use of this extension an
unconditional pedwarn in GNU C++, instead of "if (pedantic) pedwarn (...)" as
it is now.  That would still allow people to use -fpermissive to allow
non-dependent zero-length arrays.


-- 


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
  2005-10-10 16:31 ` [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays reichelt at gcc dot gnu dot org
  2005-10-18  6:28 ` mmitchel at gcc dot gnu dot org
@ 2005-10-27 20:39 ` pinskia at gcc dot gnu dot org
  2005-10-31  2:43 ` mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-27 20:39 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2005-10-27 20:39 ` pinskia at gcc dot gnu dot org
@ 2005-10-31  2:43 ` mmitchel at gcc dot gnu dot org
  2005-11-03  1:18 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-31  2:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mmitchel at gcc dot gnu dot org  2005-10-31 02:43 -------
There's an easy fix outlined in Comment #4; we should implement it.


-- 


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2005-11-03  1:18 ` pinskia at gcc dot gnu dot org
@ 2005-11-03  1:18 ` pinskia at gcc dot gnu dot org
  2005-11-03  7:06 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-03  1:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2005-11-03 01:18 -------
And the changelog in
http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00165.html


-- 


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2005-10-31  2:43 ` mmitchel at gcc dot gnu dot org
@ 2005-11-03  1:18 ` pinskia at gcc dot gnu dot org
  2005-11-03  1:18 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-03  1:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2005-11-03 01:18 -------
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00164.html


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |11/msg00164.html
           Keywords|                            |patch


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2005-11-03  1:18 ` pinskia at gcc dot gnu dot org
@ 2005-11-03  7:06 ` mmitchel at gcc dot gnu dot org
  2005-11-04  1:23 ` jconner at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-11-03  7:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from mmitchel at gcc dot gnu dot org  2005-11-03 07:06 -------
I approved the patch.


-- 


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2005-11-03  7:06 ` mmitchel at gcc dot gnu dot org
@ 2005-11-04  1:23 ` jconner at gcc dot gnu dot org
  2005-11-04  1:55 ` jconner at gcc dot gnu dot org
  2005-11-04  4:51 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 10+ messages in thread
From: jconner at gcc dot gnu dot org @ 2005-11-04  1:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jconner at gcc dot gnu dot org  2005-11-04 01:23 -------
Subject: Bug 19989

Author: jconner
Date: Fri Nov  4 01:23:22 2005
New Revision: 106468

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106468
Log:
PR c++/19989
cp/pt.c (tsubst): Accept zero-length array if tf_error is set
in complain flags.  Change error message for negative-
length array.
testsuite/g++.dg/ext/array2.C: New test.
testsuite/g++.dg/template/dependent-name3.C: New test.
testsuite/g++.dg/template/dependent-name4.C: New test.
testsuite/g++.dg/template/sfinae2.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/ext/array2.C
    trunk/gcc/testsuite/g++.dg/template/dependent-name3.C
    trunk/gcc/testsuite/g++.dg/template/dependent-name4.C
    trunk/gcc/testsuite/g++.dg/template/sfinae2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2005-11-04  1:23 ` jconner at gcc dot gnu dot org
@ 2005-11-04  1:55 ` jconner at gcc dot gnu dot org
  2005-11-04  4:51 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 10+ messages in thread
From: jconner at gcc dot gnu dot org @ 2005-11-04  1:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jconner at gcc dot gnu dot org  2005-11-04 01:55 -------
Subject: Bug 19989

Author: jconner
Date: Fri Nov  4 01:55:36 2005
New Revision: 106471

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106471
Log:
PR c++/19989
cp/pt.c (tsubst): Accept zero-length array if tf_error is set
in complain flags.  Change error message for negative-
length array.
testsuite/g++.dg/ext/array2.C: New test.
testsuite/g++.dg/template/dependent-name3.C: New test.
testsuite/g++.dg/template/dependent-name4.C: New test.
testsuite/g++.dg/template/sfinae2.C: New test.


Added:
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/ext/array2.C
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/template/dependent-name3.C
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/template/dependent-name4.C
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/template/sfinae2.C
Modified:
    branches/gcc-4_0-branch/gcc/cp/ChangeLog
    branches/gcc-4_0-branch/gcc/cp/pt.c
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays
       [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2005-11-04  1:55 ` jconner at gcc dot gnu dot org
@ 2005-11-04  4:51 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-04  4:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2005-11-04 04:51 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2005-11-04  4:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19989-1771@http.gcc.gnu.org/bugzilla/>
2005-10-10 16:31 ` [Bug c++/19989] [4.0/4.1 regression] Inconsistency with zero-sized arrays reichelt at gcc dot gnu dot org
2005-10-18  6:28 ` mmitchel at gcc dot gnu dot org
2005-10-27 20:39 ` pinskia at gcc dot gnu dot org
2005-10-31  2:43 ` mmitchel at gcc dot gnu dot org
2005-11-03  1:18 ` pinskia at gcc dot gnu dot org
2005-11-03  1:18 ` pinskia at gcc dot gnu dot org
2005-11-03  7:06 ` mmitchel at gcc dot gnu dot org
2005-11-04  1:23 ` jconner at gcc dot gnu dot org
2005-11-04  1:55 ` jconner at gcc dot gnu dot org
2005-11-04  4:51 ` pinskia 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).