diff options
author | Jason Merrill <jason@redhat.com> | 2011-08-05 15:12:24 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-08-05 15:12:24 -0400 |
commit | 9127e99420ca8f238f15c06fe7f9089e38ed862d (patch) | |
tree | 7ad801059dd0d31d7edf24ad948cdebdd40853b5 /gcc/cp | |
parent | fcbc2bedbfb3a584bd98a7792d7d088db8e8c6fd (diff) | |
download | gcc-9127e99420ca8f238f15c06fe7f9089e38ed862d.zip gcc-9127e99420ca8f238f15c06fe7f9089e38ed862d.tar.gz gcc-9127e99420ca8f238f15c06fe7f9089e38ed862d.tar.bz2 |
re PR c++/49812 (strange return type for built-in operator++(int, int))
PR c++/49812
* typeck.c (cp_build_unary_op) [POSTINCREMENT_EXPR]: Strip cv-quals.
From-SVN: r177479
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d7ad992..46eee7e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2011-08-05 Jason Merrill <jason@redhat.com> + PR c++/49812 + * typeck.c (cp_build_unary_op) [POSTINCREMENT_EXPR]: Strip cv-quals. + PR c++/49983 * parser.c (cp_parser_range_for): Only do auto deduction in template if the range is non-dependent. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index ab08eae..f53deb9 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -5220,6 +5220,9 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, } val = boolean_increment (code, arg); } + else if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR) + /* An rvalue has no cv-qualifiers. */ + val = build2 (code, cv_unqualified (TREE_TYPE (arg)), arg, inc); else val = build2 (code, TREE_TYPE (arg), arg, inc); |