d_bool_type = make_unsigned_type (1);
TREE_SET_CODE (d_bool_type, BOOLEAN_TYPE);
+ d_bool_false_node = TYPE_MIN_VALUE (d_bool_type);
+ d_bool_true_node = TYPE_MAX_VALUE (d_bool_type);
+
char8_type_node = make_unsigned_type (8);
TYPE_STRING_FLAG (char8_type_node) = 1;
if (length == 0 || result OP 0) break; */
t = build_boolop (EQ_EXPR, length, d_convert (lentype, integer_zero_node));
t = build_boolop (TRUTH_ORIF_EXPR, t, build_boolop (code, result,
- boolean_false_node));
+ d_bool_false_node));
t = build1 (EXIT_EXPR, void_type_node, t);
add_stmt (t);
return expr;
case INTEGER_CST:
- return integer_zerop (expr) ? boolean_false_node
- : boolean_true_node;
+ return integer_zerop (expr) ? d_bool_false_node
+ : d_bool_true_node;
case REAL_CST:
return real_compare (NE_EXPR, &TREE_REAL_CST (expr), &dconst0)
- ? boolean_true_node
- : boolean_false_node;
+ ? d_bool_true_node
+ : d_bool_false_node;
case ADDR_EXPR:
/* If we are taking the address of a decl that can never be null,
warning (OPT_Waddress,
"the address of %qD will always evaluate as %<true%>",
TREE_OPERAND (expr, 0));
- return boolean_true_node;
+ return d_bool_true_node;
}
break;
DTI_NULL_ARRAY,
DTI_BOTTOM_TYPE,
+ DTI_BOOL_FALSE,
+ DTI_BOOL_TRUE,
+
DTI_MAX
};
#define null_array_node d_global_trees[DTI_NULL_ARRAY]
/* The bottom type, referred to as `noreturn` in code. */
#define noreturn_type_node d_global_trees[DTI_BOTTOM_TYPE]
+/* D boolean values are always byte-sized, unlike boolean_type_node. */
+#define d_bool_false_node d_global_trees[DTI_BOOL_FALSE]
+#define d_bool_true_node d_global_trees[DTI_BOOL_TRUE]
/* A prefix for internal variables, which are not user-visible. */
#if !defined (NO_DOT_IN_LABEL)
build_dso_cdtor_fn (bool ctor_p)
{
const char *name = ctor_p ? GDC_PREFIX ("dso_ctor") : GDC_PREFIX ("dso_dtor");
- tree condition = ctor_p ? boolean_true_node : boolean_false_node;
+ tree condition = ctor_p ? d_bool_true_node : d_bool_false_node;
/* Declaration of dso_ctor/dso_dtor is:
d_finish_decl (dso_slot_node);
dso_initialized_node = build_dso_registry_var (GDC_PREFIX ("dso_initialized"),
- boolean_type_node);
+ d_bool_type);
d_finish_decl (dso_initialized_node);
/* Declare dso_ctor() and dso_dtor(). */
--- /dev/null
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112270
+// { dg-do compile }
+class CPPNamespaceDeclaration { }
+bool isNamespaceEqual (CPPNamespaceDeclaration a)
+{
+ return a ? true : isNamespaceEqual(a);
+}