[PATCH] D123955: [C2x] Disallow functions without prototypes/functions with identifier lists
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 18 12:33:49 PDT 2022
erichkeane added inline comments.
================
Comment at: clang/lib/AST/ASTContext.cpp:11243
// We really shouldn't be making a no-proto type here.
+ if (ArgTypes.empty() && Variadic && !getLangOpts().StrictPrototypes)
----------------
aaron.ballman wrote:
> erichkeane wrote:
> > How tough would it be to change this to represent always as a C++-esque `foo(...)` prototype, just always?
> C doesn't allow that (but we do if the user specifies the `overloadable` attribute), so it could be a bit tricky.
Hmm... I guess that is fair. Thinking further, we likely 'assume' that cannot be the case else where :/
================
Comment at: clang/test/Parser/c2x-attributes.c:64
+ c2x-warning 2 {{type specifier missing, defaults to 'int'}} \
+ c2x-error {{expected ';' after top level declarator}} \
+ c2x-error {{expected identifier or '('}}
----------------
aaron.ballman wrote:
> erichkeane wrote:
> > This is an unfortunate change in diagnostic quality.
> Agreed, but thankfully this situation should be exceedingly rare (trying to put `[[]]` attributes after a function definition with an identifier list).
Ah! less concerned then.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123955/new/
https://reviews.llvm.org/D123955
More information about the cfe-commits
mailing list