From f8637360e2ea0e1c697bcfc24dafa8f12d31171c Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 15 Jan 2015 08:41:25 +0000 Subject: 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 --- clang/lib/AST/ASTContext.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/AST/ASTContext.cpp') 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(*this), TypeVisibilityAttr::Default)); return NewDecl; } -- cgit v1.2.3