public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11490] New: [3.4 regression] Spurious signedness warning with templates
@ 2003-07-10 16:29 bangerth at dealii dot org
  2003-07-10 17:44 ` [Bug c++/11490] " pinskia at physics dot uc dot edu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2003-07-10 16:29 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] Spurious signedness warning with
                    templates
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org

For this code
-------------------------
template <int N> bool f() {
  unsigned int i=0;
  return i!=N;
}

template bool f<2> ();
-------------------------
we did not get warnings in the comparison i!=N, but we do now:
tmp/gg> ../build-gcc/gcc-install/bin/c++ -c x.cc -W
x.cc: In function `bool f()':
x.cc:3: warning: comparison between signed and unsigned integer expressions

This must have crept in in the last two or three days, since my nightly
builds with -W -Werror succeeded until 2003-07-07. It's not present on
the 3.3 branch.

Now, it's certainly arguable whether this warning is justified, after all
i is unsigned, and N is signed. However, if the warning were postponed
until instantiation time, the exact value of N were known, and in this
case one could check whether N is really negative, or if it is in fact
positive.

I personally would appreciate if this would be handled quickly, since it
hits our code at several 100 places :-(

W.


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

* [Bug c++/11490] [3.4 regression] Spurious signedness warning with templates
  2003-07-10 16:29 [Bug c++/11490] New: [3.4 regression] Spurious signedness warning with templates bangerth at dealii dot org
@ 2003-07-10 17:44 ` pinskia at physics dot uc dot edu
  2003-07-10 19:14 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-10 17:44 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-10 17:44:12
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-10 17:44 -------
I can confirm this even after removing the explicit instantiation on the mainline 
(20030710).  The warning does not happen on 20030708.


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

* [Bug c++/11490] [3.4 regression] Spurious signedness warning with templates
  2003-07-10 16:29 [Bug c++/11490] New: [3.4 regression] Spurious signedness warning with templates bangerth at dealii dot org
  2003-07-10 17:44 ` [Bug c++/11490] " pinskia at physics dot uc dot edu
@ 2003-07-10 19:14 ` bangerth at dealii dot org
  2003-07-11 14:18 ` pinskia at physics dot uc dot edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2003-07-10 19:14 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From bangerth at dealii dot org  2003-07-10 19:14 -------
Yeah, I guess that was obvious that I could have omitted the instantiation --
after all  was pounding on the point that the warning was generated at
definition time, not at instantiation time...

Sorry for having been so verbose (50% longer than necessary) in my testcase :-)
W.


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

* [Bug c++/11490] [3.4 regression] Spurious signedness warning with templates
  2003-07-10 16:29 [Bug c++/11490] New: [3.4 regression] Spurious signedness warning with templates bangerth at dealii dot org
  2003-07-10 17:44 ` [Bug c++/11490] " pinskia at physics dot uc dot edu
  2003-07-10 19:14 ` bangerth at dealii dot org
@ 2003-07-11 14:18 ` pinskia at physics dot uc dot edu
  2003-07-11 14:34 ` dhazeghi at yahoo dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-11 14:18 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

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


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-11 14:18 -------
Fixed by:
2003-07-10  Mark Mitchell

        * typeck.c (build_binary_op): Do not warn about signed
        vs. unsigned comparisons in the bodies of templates.


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

* [Bug c++/11490] [3.4 regression] Spurious signedness warning with templates
  2003-07-10 16:29 [Bug c++/11490] New: [3.4 regression] Spurious signedness warning with templates bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2003-07-11 14:18 ` pinskia at physics dot uc dot edu
@ 2003-07-11 14:34 ` dhazeghi at yahoo dot com
  2003-07-11 14:57 ` pinskia at physics dot uc dot edu
  2003-09-07  3:43 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-07-11 14:34 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From dhazeghi at yahoo dot com  2003-07-11 14:34 -------
Did the fix include a testcase?


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

* [Bug c++/11490] [3.4 regression] Spurious signedness warning with templates
  2003-07-10 16:29 [Bug c++/11490] New: [3.4 regression] Spurious signedness warning with templates bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2003-07-11 14:34 ` dhazeghi at yahoo dot com
@ 2003-07-11 14:57 ` pinskia at physics dot uc dot edu
  2003-09-07  3:43 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-11 14:57 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-11 14:57 -------
No but I will add one when I get cvs access.


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

* [Bug c++/11490] [3.4 regression] Spurious signedness warning with templates
  2003-07-10 16:29 [Bug c++/11490] New: [3.4 regression] Spurious signedness warning with templates bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2003-07-11 14:57 ` pinskia at physics dot uc dot edu
@ 2003-09-07  3:43 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-09-07  3:43 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-09-07 03:43 -------
Subject: Bug 11490

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2003-09-07 03:43:15

Added files:
	gcc/testsuite/g++.dg/lookup: scoped7.C 
	gcc/testsuite/g++.dg/other: static1.C 
	gcc/testsuite/g++.dg/warn: template-1.C 
	gcc/testsuite/g++.dg/template: crash10.C call1.C 
	gcc/testsuite/g++.dg/overload: VLA.C 

Log message:
	2003-09-06  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR c++/11507
	* g++.dg/lookup/scoped7.C: New test.
	
	PR c++/9574
	* g++.dg/other/static1.C: New test.
	
	PR c++/11490
	* g++.dg/warn/template-1.C: New test.
	
	PR c++/11432
	* g++.dg/template/crash10.C: New test.
	
	PR c++/2478
	* g++.dg/overload/VLA.C: New test.
	
	PR c++/10804
	* g++.dg/template/call1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/scoped7.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/static1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/template-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash10.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/call1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/overload/VLA.C.diff?cvsroot=gcc&r1=NONE&r2=1.1


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

end of thread, other threads:[~2003-09-07  3:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-10 16:29 [Bug c++/11490] New: [3.4 regression] Spurious signedness warning with templates bangerth at dealii dot org
2003-07-10 17:44 ` [Bug c++/11490] " pinskia at physics dot uc dot edu
2003-07-10 19:14 ` bangerth at dealii dot org
2003-07-11 14:18 ` pinskia at physics dot uc dot edu
2003-07-11 14:34 ` dhazeghi at yahoo dot com
2003-07-11 14:57 ` pinskia at physics dot uc dot edu
2003-09-07  3:43 ` 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).