aboutsummaryrefslogtreecommitdiff
path: root/gcc/convert.h
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-02-08 10:31:47 -0500
committerJason Merrill <jason@gcc.gnu.org>2016-02-08 10:31:47 -0500
commit415594bb5c49d69f5350401d07abac62bce8656a (patch)
treefffcfe2c7dae6ee698e378ab02e9cdf2d86a254e /gcc/convert.h
parentae9dd7f3f8219057b459356c8234bf4aa73f7e1e (diff)
downloadgcc-415594bb5c49d69f5350401d07abac62bce8656a.zip
gcc-415594bb5c49d69f5350401d07abac62bce8656a.tar.gz
gcc-415594bb5c49d69f5350401d07abac62bce8656a.tar.bz2
re PR c++/69631 (Bogus overflow in constant expression error)
PR c++/69631 gcc/ * convert.c (convert_to_integer_1): Check dofold on truncation distribution. (convert_to_pointer_maybe_fold, convert_to_real_maybe_fold) (convert_to_integer_maybe_fold, convert_to_complex_maybe_fold): Rename from *_nofold. * convert.h (convert_to_pointer_nofold, convert_to_integer_nofold) (convert_to_real_nofold, convert_to_complex_nofold): New inlines. gcc/cp/ * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New. * cvt.c (convert): Pass CONV_BACKEND_CONVERT. (ocp_convert): Use *_maybe_fold. (cp_convert_to_pointer): Add dofold parameter. * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert. From-SVN: r233216
Diffstat (limited to 'gcc/convert.h')
-rw-r--r--gcc/convert.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/convert.h b/gcc/convert.h
index aa8fb9b..bee280d 100644
--- a/gcc/convert.h
+++ b/gcc/convert.h
@@ -21,14 +21,23 @@ along with GCC; see the file COPYING3. If not see
#define GCC_CONVERT_H
extern tree convert_to_integer (tree, tree);
-extern tree convert_to_integer_nofold (tree, tree);
+extern tree convert_to_integer_maybe_fold (tree, tree, bool);
extern tree convert_to_pointer (tree, tree);
-extern tree convert_to_pointer_nofold (tree, tree);
+extern tree convert_to_pointer_maybe_fold (tree, tree, bool);
extern tree convert_to_real (tree, tree);
-extern tree convert_to_real_nofold (tree, tree);
+extern tree convert_to_real_maybe_fold (tree, tree, bool);
extern tree convert_to_fixed (tree, tree);
extern tree convert_to_complex (tree, tree);
-extern tree convert_to_complex_nofold (tree, tree);
+extern tree convert_to_complex_maybe_fold (tree, tree, bool);
extern tree convert_to_vector (tree, tree);
+extern inline tree convert_to_integer_nofold (tree t, tree x)
+{ return convert_to_integer_maybe_fold (t, x, false); }
+extern inline tree convert_to_pointer_nofold (tree t, tree x)
+{ return convert_to_pointer_maybe_fold (t, x, false); }
+extern inline tree convert_to_real_nofold (tree t, tree x)
+{ return convert_to_real_maybe_fold (t, x, false); }
+extern inline tree convert_to_complex_nofold (tree t, tree x)
+{ return convert_to_complex_maybe_fold (t, x, false); }
+
#endif /* GCC_CONVERT_H */