aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-05-31 13:03:23 +0000
committerJason Merrill <jason@redhat.com>2013-05-31 13:03:23 +0000
commit6f7fd27ef4a3e607ae96c8fff3e1e031969856c8 (patch)
tree3f31f03e40c652c226aeb49ef4b470af269c0946 /gcc/cp
parentffb5ac9cd21f8ce4c2a238e7a385e9b3667efb71 (diff)
PR c++/56930
* call.c (convert_like_real): Use cp_convert_and_check. * cvt.c (cp_convert_and_check): Use maybe_constant_value. * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR. (potential_constant_expression_1): Handle OMP_ATOMIC*. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@199539 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/cp/cvt.c3
-rw-r--r--gcc/cp/semantics.c7
4 files changed, 20 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ffc0ccd8b06..b6737907311 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2013-05-31 Jason Merrill <jason@redhat.com>
+
+ PR c++/56930
+ * call.c (convert_like_real): Use cp_convert_and_check.
+ * cvt.c (cp_convert_and_check): Use maybe_constant_value.
+ * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
+ (potential_constant_expression_1): Handle OMP_ATOMIC*.
+
2013-05-31 Release Manager
* GCC 4.8.1 released.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 72c1dac2566..9275133d636 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6195,8 +6195,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
if (convs->check_narrowing)
check_narrowing (totype, expr);
- if (issue_conversion_warnings && (complain & tf_warning))
- expr = convert_and_check (totype, expr);
+ if (issue_conversion_warnings)
+ expr = cp_convert_and_check (totype, expr, complain);
else
expr = convert (totype, expr);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 348e6082ceb..f83f3704927 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -620,6 +620,9 @@ cp_convert_and_check (tree type, tree expr, tsubst_flags_t complain)
if (TREE_TYPE (expr) == type)
return expr;
+
+ if (TREE_CODE (expr) == SIZEOF_EXPR)
+ expr = maybe_constant_value (expr);
result = cp_convert (type, expr, complain);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 8a7fe38074d..0420a413c37 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7990,6 +7990,7 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t,
case UNGT_EXPR:
case UNGE_EXPR:
case UNEQ_EXPR:
+ case LTGT_EXPR:
case RANGE_EXPR:
case COMPLEX_EXPR:
r = cxx_eval_binary_expression (call, t, allow_non_constant, addr,
@@ -8846,6 +8847,12 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
}
return false;
+ case OMP_ATOMIC:
+ case OMP_ATOMIC_READ:
+ case OMP_ATOMIC_CAPTURE_OLD:
+ case OMP_ATOMIC_CAPTURE_NEW:
+ return false;
+
default:
if (objc_is_property_ref (t))
return false;