From ef3c69406f73b892a3d5023ea42b3d7ed9c99d33 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 8 Jan 2013 14:58:32 +0000 Subject: [PATCH] Clear the LV cache when setting the instantiated from link. Fixes pr14835. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171857 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ASTContext.cpp | 1 + test/SemaCXX/visibility.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/SemaCXX/visibility.cpp diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 426e67cc79..dc398f36ec 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -949,6 +949,7 @@ ASTContext::setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, "Already noted what static data member was instantiated from"); InstantiatedFromStaticDataMember[Inst] = new (*this) MemberSpecializationInfo(Tmpl, TSK, PointOfInstantiation); + Inst->ClearLVCache(); } FunctionDecl *ASTContext::getClassScopeSpecializationPattern( diff --git a/test/SemaCXX/visibility.cpp b/test/SemaCXX/visibility.cpp new file mode 100644 index 0000000000..434b3c06c1 --- /dev/null +++ b/test/SemaCXX/visibility.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsyntax-only %s + +namespace test1 { + template + struct C2 + { + static int p __attribute__((visibility("hidden"))); + }; + int f() { + return C2::p; + } +} -- 2.40.0