Bug 11833

Summary: [3.4 regression] Spurious warning for comma-operator in templates
Product: gcc Reporter: Wolfgang Bangerth <bangerth>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: critical CC: gcc-bugs
Priority: P1    
Version: 3.4.0   
Target Milestone: 3.4.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Wolfgang Bangerth 2003-08-06 14:43:47 UTC
Here's a very annoying regression that swamps my builds in warning
messages:
------------------------------
void g (int, int);

template <int> void f () {
  for (int i;; ++i, ++i)
    g(i,i);
}

template void f<1> ();
------------------------------
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -W -Wall -c x.cc
x.cc: In function `void f()':
x.cc:4: warning: left-hand operand of comma expression has no effect

Clearly, the left hand side of the comma expression _does_ have
an effect. The warning disappears when the function is not a template.

W.
Comment 1 Andrew Pinski 2003-08-06 14:46:45 UTC
This is a dup of bug 11512.

*** This bug has been marked as a duplicate of 11512 ***
Comment 2 Wolfgang Bangerth 2003-08-06 14:55:58 UTC
Subject: Re:  [3.4 regression] Spurious warning for comma-operator in templates


> *** This bug has been marked as a duplicate of 11512 ***

Darn, I knew I had seen this somewhere before. Thanks Andrew!
W.

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/