OSDN Git Service

PR c++/19564
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Dec 2006 05:49:06 +0000 (05:49 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Dec 2006 05:49:06 +0000 (05:49 +0000)
commite534436e6eabb2900b763cceebab8dcdd2f05fcb
tree50f6bb9f779d4a706c820c0da135fd92bcd9c11a
parentd3610beab162bbb9b18ffd643cd412dac23b6da3
PR c++/19564
PR c++/19756
gcc/:
* c-typeck.c (parser_build_binary_op): Move parentheses warnings
to warn_about_parentheses in c-common.c.
* c-common.c (warn_about_parentheses): New function.
* c-common.h (warn_about_parentheses): Declare.
* doc/invoke.texi (Warning Options): Update -Wparentheses
description.
gcc/cp/:
* parser.c (cp_parser_expression_stack_entry): Add field
lhs_type.
(cp_parser_binary_expression): Track tree code of left hand side
of expression.  Use it when calling build_x_binary_op.
(cp_parser_selection_statement): Add if_p parameter.  Change all
callers.  Warn about ambiguous else.
(cp_parser_statement): Add if_p parameter.  Change all callers.
(cp_parser_implicitly_scoped_statement): Likewise.
* typeck.c (build_x_binary_op): Add parameters arg1_code and
arg2_code.  Change all callers.  Call warn_about_parentheses.
* cp-tree.h (build_x_binary_op): Update declaration.
gcc/testsuite/:
* g++.dg/warn/Wparentheses-5.C: New test.
* g++.dg/warn/Wparentheses-6.C: New test.
* g++.dg/warn/Wparentheses-7.C: New test.
* g++.dg/warn/Wparentheses-8.C: New test.
* g++.dg/warn/Wparentheses-9.C: New test.
* g++.dg/warn/Wparentheses-10.C: New test.
* g++.dg/warn/Wparentheses-11.C: New test.
* g++.dg/warn/Wparentheses-12.C: New test.
* g++.dg/warn/Wparentheses-13.C: New test.
* g++.dg/warn/Wparentheses-14.C: New test.
* g++.dg/warn/Wparentheses-15.C: New test.
* g++.dg/warn/Wparentheses-16.C: New test.
* g++.dg/warn/Wparentheses-17.C: New test.
* g++.dg/warn/Wparentheses-18.C: New test.
* g++.dg/warn/Wparentheses-19.C: New test.
* g++.dg/warn/Wparentheses-20.C: New test.
* g++.dg/warn/Wparentheses-21.C: New test.
libstdc++-v3/:
* include/bits/locale_facets.tcc (num_get<>::_M_extract_float):
Add parentheses around && within || to avoid warning.
(num_get<>::_M_extract_int): Likewise.
(money_get<>::_M_extract): Likewise.
(num_get<>::do_get(iter_type, iter_type, ios_base&,
ios_base::iostate&, void*&)): Add parentheses around & within | to
avoid warning.
(num_put<>::do_put(iter_type, ios_base&, char_type, const void*)):
Likewise.
* include/bits/streambuf_iterator.h (istreambuf_iterator::equal):
Add parentheses around && within || to avoid warning.
* libsupc++/tinfo.cc (__do_dyncast): Likewise.
* src/locale.cc (locale::_S_normalize_category): Likewise.
* include/bits/stl_tree.h (_Rb_tree<>::_M_insert_unique): Add
braces to avoid ambiguous else warning.
* src/strstream.cc (strstreambuf::_M_free): Likewise.
* src/tree.cc (_Rb_tree_rebalance_for_erase): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119855 138bc75d-0d04-0410-961f-82ee72b054a4
36 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/typeck.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wparentheses-10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-12.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-13.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-14.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-15.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-16.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-17.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-18.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-19.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-20.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-21.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-8.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-9.C [new file with mode: 0644]
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_facets.tcc
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/include/bits/streambuf_iterator.h
libstdc++-v3/libsupc++/tinfo.cc
libstdc++-v3/src/locale.cc
libstdc++-v3/src/strstream.cc
libstdc++-v3/src/tree.cc