This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11833] New: [3.4 regression] Spurious warning for comma-operator in templates


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

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

           Summary: [3.4 regression] Spurious warning for comma-operator in
                    templates
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: critical
          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

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]