]> granicus.if.org Git - clang/commit
[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)
commit2926189c9bf4982cd6a0e9cc00d785837112d457
tree61c83c35cbd29dd07eb2f931fae17805cecbad85
parent7cb94b0502fe0fbf58c5c6f213f1da9386c08034
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336239 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/Sema/attr-format_arg.c