mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
Fix handling of template parameters. Found by inspection. GCC 4.7 agrees
with this testcase. llvm-svn: 155301
This commit is contained in:
parent
32854e2727
commit
8add48ec9e
@ -423,9 +423,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,
|
||||
// - a template, unless it is a function template that has
|
||||
// internal linkage (Clause 14);
|
||||
} else if (const TemplateDecl *temp = dyn_cast<TemplateDecl>(D)) {
|
||||
if (!OnlyTemplate)
|
||||
LV.merge(getLVForTemplateParameterList(temp->getTemplateParameters()));
|
||||
|
||||
LV.merge(getLVForTemplateParameterList(temp->getTemplateParameters()));
|
||||
// - a namespace (7.3), unless it is declared within an unnamed
|
||||
// namespace.
|
||||
} else if (isa<NamespaceDecl>(D) && !D->isInAnonymousNamespace()) {
|
||||
|
@ -5,6 +5,20 @@
|
||||
#define PROTECTED __attribute__((visibility("protected")))
|
||||
#define DEFAULT __attribute__((visibility("default")))
|
||||
|
||||
namespace test30 {
|
||||
// When H is hidden, it should make X hidden, even if the template argument
|
||||
// is not.
|
||||
struct H {
|
||||
};
|
||||
template<H *T>
|
||||
struct X {
|
||||
};
|
||||
H DEFAULT a;
|
||||
X<&a> b;
|
||||
// CHECK: _ZN6test301bE = global
|
||||
// CHECK-HIDDEN: _ZN6test301bE = hidden global
|
||||
}
|
||||
|
||||
namespace test25 {
|
||||
template<typename T>
|
||||
struct X {
|
||||
|
Loading…
Reference in New Issue
Block a user