Allow parameter names to be elided in a function definition in C.
authorAaron Ballman <aaron@aaronballman.com>
Tue, 7 Apr 2020 18:42:29 +0000 (14:42 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 7 Apr 2020 18:43:38 +0000 (14:43 -0400)
commit86b5eabfeab164dcb680f6690e7718e3d21ceeb5
tree673e8dd9e86c3c38e3ad9d9371f43a29ba441a41
parentf8b6529218f22ea112aabebe13d58cfef6a9c09a
Allow parameter names to be elided in a function definition in C.

WG14 has adopted N2480 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2480.pdf)
into C2x at the meetings last week, allowing parameter names of a function
definition to be elided. This patch relaxes the error so that C++ and C2x do not
diagnose this situation, and modes before C2x will allow it as an extension.

This also adds the same feature to ObjC blocks under the assumption that ObjC
wishes to follow the C standard in this regard.
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/block-args.c
clang/test/Sema/c89.c
clang/test/Sema/function.c