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++/29765] New: -Wparentheses does not warn on single equals sign inside if statement


When compiling the following code with -Wparentheses, no warning is shown:

cat <<EOF >missing-parentheses.cpp
int main(int argc, char** argv)
{
  int a = 1;
  int b = 2;
  if (a = b)
    a++;
  return 0;
}
EOF
g++ -c -Wparentheses missing-parentheses.cpp


-- 
           Summary: -Wparentheses does not warn on single equals sign inside
                    if statement
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bart dot vanassche at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: powerpc-unknown-linux


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


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