diff options
-rw-r--r-- | inline.c | 8 | ||||
-rw-r--r-- | validation/inline-generic.c | 10 |
2 files changed, 18 insertions, 0 deletions
@@ -274,6 +274,14 @@ static struct expression * copy_expression(struct expression *expr) } break; } + case EXPR_GENERIC: + expr = dup_expression(expr); + expr->control = copy_expression(expr->control); + if (!evaluate_expression(expr)) + return NULL; + expr = copy_expression(expr); + break; + default: warning(expr->pos, "trying to copy expression type %d", expr->type); } diff --git a/validation/inline-generic.c b/validation/inline-generic.c new file mode 100644 index 00000000..1f05c079 --- /dev/null +++ b/validation/inline-generic.c @@ -0,0 +1,10 @@ +extern int a, b; +inline int c(void) { return a++; } +inline int e(int d) { return 0; } +inline unsigned f(void) { return e(_Generic(b, int: c())); } +static int g(void) { return f(); } +static int h(void) { return f(); } + +/* + * check-name: inline-generic + */ |