aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-22 21:08:50 +0000
committerChris Lattner <sabre@nondot.org>2010-03-22 21:08:50 +0000
commit3c989027f68e2d9dfd57c018ccc550bd9fb79920 (patch)
tree60724824505b72e3177d80898c8800b48e6bd300 /lib/Sema/SemaDeclAttr.cpp
parenta87d477c69ec31a0d24b7c53e4a781fb76617809 (diff)
(re)implement PR6542, accepting and discarding the __gcc_tdiag__
format attribute specifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 73a34f8107..5a7a3c31fe 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1115,6 +1115,7 @@ enum FormatAttrKind {
NSStringFormat,
StrftimeFormat,
SupportedFormat,
+ IgnoredFormat,
InvalidFormat
};
@@ -1136,6 +1137,9 @@ static FormatAttrKind getFormatAttrKind(llvm::StringRef Format) {
Format == "zcmn_err")
return SupportedFormat;
+ if (Format == "gcc_tdiag")
+ return IgnoredFormat;
+
return InvalidFormat;
}
@@ -1171,6 +1175,10 @@ static void HandleFormatAttr(Decl *d, const AttributeList &Attr, Sema &S) {
// Check for supported formats.
FormatAttrKind Kind = getFormatAttrKind(Format);
+
+ if (Kind == IgnoredFormat)
+ return;
+
if (Kind == InvalidFormat) {
S.Diag(Attr.getLoc(), diag::warn_attribute_type_not_supported)
<< "format" << Attr.getParameterName()->getName();