aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-11-03 13:42:59 -0500
committerJason Merrill <jason@gcc.gnu.org>2009-11-03 13:42:59 -0500
commita638b034245e39678a9f24b823df0bba0f1453d0 (patch)
tree716e3fa3e262779057f0f5ce8957916220dfc69f /gcc/cp/call.c
parent6e924e079b7f329afe359e91aa4db7856a387bc9 (diff)
downloadgcc-a638b034245e39678a9f24b823df0bba0f1453d0.zip
gcc-a638b034245e39678a9f24b823df0bba0f1453d0.tar.gz
gcc-a638b034245e39678a9f24b823df0bba0f1453d0.tar.bz2
re PR c++/41815 ([C++0x] GCC wrongly treats rvalues of non-class type cv-qualified)
PR c++/41815 * call.c (build_call_a): Strip cv-quals from rvalue result. From-SVN: r153862
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 674e59d..0979f3a 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -313,6 +313,9 @@ build_call_a (tree function, int n, tree *argarray)
gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE
|| TREE_CODE (fntype) == METHOD_TYPE);
result_type = TREE_TYPE (fntype);
+ /* An rvalue has no cv-qualifiers. */
+ if (SCALAR_TYPE_P (result_type) || VOID_TYPE_P (result_type))
+ result_type = cv_unqualified (result_type);
if (TREE_CODE (function) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL)