aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-23 18:22:55 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-23 18:22:55 +0000
commitb3efa98e320590e8be9d62818e89e599303e65b4 (patch)
treee1dfe49a1b96f17d9dc5815273bee027ed5d5343 /lib/Sema/SemaDeclAttr.cpp
parent87de6497f45243fbcef6dac5be6a641ca9331f61 (diff)
Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and <rdar://problem/6818429>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69905 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index d0c0ab86e1..d05b99ac36 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1474,7 +1474,11 @@ static void HandleGNUInlineAttr(Decl *d, const AttributeList &Attr, Sema &S) {
return;
}
- d->addAttr(::new (S.Context) GNUInlineAttr());
+ // FIXME: We only do this because of the hack in
+ // Sema::ActOnFunctionDeclarator, which needs to add the
+ // GNUInlineAttr early.
+ if (!d->hasAttr<GNUInlineAttr>())
+ d->addAttr(::new (S.Context) GNUInlineAttr());
}
static void HandleRegparmAttr(Decl *d, const AttributeList &Attr, Sema &S) {