From bc52595e01323ca22d65c68aafd53a1acb8c1fb6 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 23 Mar 2010 14:44:19 +0000 Subject: [PATCH] Ignore a more comprehensive set of gcc-special format attributes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99277 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclAttr.cpp | 3 ++- test/Sema/attr-format.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 5a7a3c31fe..a81ad768b8 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -1137,7 +1137,8 @@ static FormatAttrKind getFormatAttrKind(llvm::StringRef Format) { Format == "zcmn_err") return SupportedFormat; - if (Format == "gcc_tdiag") + if (Format == "gcc_diag" || Format == "gcc_cdiag" || + Format == "gcc_cxxdiag" || Format == "gcc_tdiag") return IgnoredFormat; return InvalidFormat; diff --git a/test/Sema/attr-format.c b/test/Sema/attr-format.c index 34102c6603..0fadf98f97 100644 --- a/test/Sema/attr-format.c +++ b/test/Sema/attr-format.c @@ -71,4 +71,10 @@ foo2(const char *fmt, va_list va) { // PR6542 extern void gcc_format (const char *, ...) + __attribute__ ((__format__(__gcc_diag__, 1, 2))); +extern void gcc_cformat (const char *, ...) + __attribute__ ((__format__(__gcc_cdiag__, 1, 2))); +extern void gcc_cxxformat (const char *, ...) + __attribute__ ((__format__(__gcc_cxxdiag__, 1, 2))); +extern void gcc_tformat (const char *, ...) __attribute__ ((__format__(__gcc_tdiag__, 1, 2))); -- 2.40.0