summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-01-15 08:41:25 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-01-15 08:41:25 +0000
commitf8637360e2ea0e1c697bcfc24dafa8f12d31171c (patch)
tree2489bd8e7efc44c5ded3be493be5483eaecb87ce /clang/lib/AST/ASTContext.cpp
parent61635440a935fd8192fcc3c76bf6bac7b68166b3 (diff)
downloadbcm5719-llvm-f8637360e2ea0e1c697bcfc24dafa8f12d31171c.tar.gz
bcm5719-llvm-f8637360e2ea0e1c697bcfc24dafa8f12d31171c.zip
AST: Ensure implicit records have default visibility
Types composed with certain implicit record types would have their RTTI marked as hidden because the implicit record type didn't have any visibility. This manifests itself as triggering false positives from tools like clang's -fsantize=function feature. The RTTI for a function type's return type wouldn't match if the return type was an implicit record type. Patch by Stephan Bergmann! llvm-svn: 226148
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 6b864d0f0ac..88f6bfba024 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -876,6 +876,8 @@ RecordDecl *ASTContext::buildImplicitRecord(StringRef Name,
NewDecl = RecordDecl::Create(*this, TK, getTranslationUnitDecl(), Loc, Loc,
&Idents.get(Name));
NewDecl->setImplicit();
+ NewDecl->addAttr(TypeVisibilityAttr::CreateImplicit(
+ const_cast<ASTContext &>(*this), TypeVisibilityAttr::Default));
return NewDecl;
}
OpenPOWER on IntegriCloud