diff options
author | Michael Forney <mforney@mforney.org> | 2020-01-30 13:53:18 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2020-01-30 13:53:18 -0800 |
commit | 5b575aa2e3e42085d9087210b41560cf5849c746 (patch) | |
tree | ea8cdc078cc02eab821cc22cb099730188944ec1 /decl.c | |
parent | 3849dd77204177fce2568b5bbace6e400c6a6064 (diff) |
decl: Better check for inline definitions
Diffstat (limited to 'decl.c')
-rw-r--r-- | decl.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -994,6 +994,7 @@ decl(struct scope *s, struct func *f) } } d = declcommon(s, kind, name, asmname, t, tq, sc, prior); + d->inlinedefn = d->linkage == LINKEXTERN && fs & FUNCINLINE && !(sc & SCEXTERN) && (!prior || prior->inlinedefn); if (tok.kind == TLBRACE) { if (!allowfunc) error(&tok.loc, "function definition not allowed"); @@ -1003,7 +1004,7 @@ decl(struct scope *s, struct func *f) f = mkfunc(d, name, t, s); stmt(f, s); /* XXX: need to keep track of function in case a later declaration specifies extern */ - if (!(fs & FUNCINLINE) || sc) + if (!d->inlinedefn) emitfunc(f, d->linkage == LINKEXTERN); s = delscope(s); delfunc(f); |