[Sema] Consider all format_arg attributes.
authorMichael Kruse <llvm@meinersbur.de>
Wed, 4 Jul 2018 01:37:11 +0000 (01:37 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Wed, 4 Jul 2018 01:37:11 +0000 (01:37 +0000)
commitf18adbb3cb327d119e6ba595a211afcc4a6ba196
treee44c45564f3d195d5a68cc5ff8e938270a8c0c1f
parentaeeac6d41ce2db11e5e72a21f197e46dd724950c
[Sema] Consider all format_arg attributes.

If a function has multiple format_arg attributes, clang only considers
the first it finds (because AttributeLists are in reverse order, not
necessarily the textually first) and ignores all others.

Loop over all FormatArgAttr to print warnings for all declared
format_arg attributes.

For instance, libintl's ngettext (select plural or singular version of
format string) has two __format_arg__ attributes.

Differential Revision: https://reviews.llvm.org/D48734

llvm-svn: 336239
clang/lib/Sema/SemaChecking.cpp
clang/test/Sema/attr-format_arg.c