From 9a5a6dddf910eedaf80458420d4089570dfa49b2 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 8 Jan 2013 04:04:30 +0000 Subject: Clear the LV cache when merging the availability attribute. The availability implies default visibility, so it can change the computed visibility. llvm-svn: 171840 --- clang/lib/Sema/SemaDecl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 84b0d3f36bf..3b37890f218 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1790,12 +1790,16 @@ DeclHasAttr(const Decl *D, const Attr *A) { bool Sema::mergeDeclAttribute(Decl *D, InheritableAttr *Attr) { InheritableAttr *NewAttr = NULL; - if (AvailabilityAttr *AA = dyn_cast(Attr)) + if (AvailabilityAttr *AA = dyn_cast(Attr)) { NewAttr = mergeAvailabilityAttr(D, AA->getRange(), AA->getPlatform(), AA->getIntroduced(), AA->getDeprecated(), AA->getObsoleted(), AA->getUnavailable(), AA->getMessage()); - else if (VisibilityAttr *VA = dyn_cast(Attr)) { + if (NewAttr) { + NamedDecl *ND = cast(D); + ND->ClearLVCache(); + } + } else if (VisibilityAttr *VA = dyn_cast(Attr)) { NewAttr = mergeVisibilityAttr(D, VA->getRange(), VA->getVisibility()); if (NewAttr) { NamedDecl *ND = cast(D); -- cgit v1.2.3