summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-12-29 23:43:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-12-29 23:43:00 +0000
commit9463dce9bf90d63480c894452cc82db1de182823 (patch)
tree10939159390ad5665cf019c23d51507f2149cc02 /clang/lib
parent9dff378a12c62528ff8b003a21861fbd3fee5043 (diff)
downloadbcm5719-llvm-9463dce9bf90d63480c894452cc82db1de182823.tar.gz
bcm5719-llvm-9463dce9bf90d63480c894452cc82db1de182823.zip
Don't warn for undefined but used decls that are external because of a typedef.
This fixes pr14736. It is fairly ugly, but I don't think we can do much better as we have to wait at least until the end of the typedef to know if the function will have external linkage or not. llvm-svn: 171240
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/Sema.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 4b82069a624..0c5e8db1aa8 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -394,6 +394,9 @@ static void checkUndefinedInternals(Sema &S) {
// Ignore attributes that have become invalid.
if (decl->isInvalidDecl()) continue;
+ // If we found out that the decl is external, don't warn.
+ if (decl->getLinkage() == ExternalLinkage) continue;
+
// __attribute__((weakref)) is basically a definition.
if (decl->hasAttr<WeakRefAttr>()) continue;
OpenPOWER on IntegriCloud