&& pointers_compatible(true_type, false_type)) {
/* ok */
result_type = true_type;
+ } else if (is_type_pointer(true_type)
+ && is_null_pointer_constant(false_expression)) {
+ result_type = true_type;
+ } else if (is_type_pointer(false_type)
+ && is_null_pointer_constant(true_expression)) {
+ result_type = false_type;
} else {
- /* TODO */
+ /* TODO: one pointer to void*, other some pointer */
+
if (is_type_valid(true_type) && is_type_valid(false_type)) {
type_error_incompatible("while parsing conditional",
expression->base.source_position, true_type,
int main(int argc, char **argv)
{
- char *arg = argc > 1 ? argv[1] : 0;
+ void *nu = 0;
+ char *arg1 = argc > 1 ? argv[1] : 0;
+ char *arg2 = argc <= 1 ? 0 : argv[1];
+ char *arg3 = argc > 1 ? argv[1] : nu;
+ char *arg4 = argc <= 1 ? nu : argv[1];
- if(arg != 0) {
- puts(arg);
+ if(arg1 != 0) {
+ puts(arg1);
+ puts(arg2);
+ puts(arg3);
+ puts(arg4);
}
return 0;