aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/expression.h
diff options
context:
space:
mode:
authorNicolai Stange <nicstange@gmail.com>2016-02-01 03:31:47 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-03-31 02:14:10 +0200
commit1b62f0f61f38d8f6881c6ee14da2f9137bd68fc7 (patch)
tree2f2596bbdfd95512d57ae0da2dc3c7acc51f9f73 /expression.h
parent2919ca4cd57c4633bccf26b01cb2b8c00271446d (diff)
downloadsparse-dev-1b62f0f61f38d8f6881c6ee14da2f9137bd68fc7.tar.gz
constexpr: examine constness of casts at evaluation only
Move the whole calculation of cast expressions' constness flags to the evaluation phase such that expressions like (int)__builtin_choose_expr(0, 0, 0) can now be recognized as qualifying as integer constant expressions. Signed-off-by: Nicolai Stange <nicstange@gmail.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'expression.h')
-rw-r--r--expression.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/expression.h b/expression.h
index ec94ff4a..c084783c 100644
--- a/expression.h
+++ b/expression.h
@@ -120,6 +120,13 @@ enum constexpr_flag {
CEF_CONST_MASK = (CEF_INT | CEF_FLOAT | CEF_CHAR),
};
+/*
+ * not an integer constant expression => neither of integer,
+ * enumeration and character constant
+ */
+#define CEF_CLR_ICE \
+ (CEF_ICE | CEF_INT | CEF_ENUM | CEF_CHAR)
+
enum {
Taint_comma = 1,
}; /* for expr->taint */