[cfe-commits] r155368 - in /cfe/trunk: lib/AST/Decl.cpp test/CodeGenCXX/visibility.cpp
Rafael Espindola
rafael.espindola at gmail.com
Mon Apr 23 10:51:56 PDT 2012
Author: rafael
Date: Mon Apr 23 12:51:55 2012
New Revision: 155368
URL: http://llvm.org/viewvc/llvm-project?rev=155368&view=rev
Log:
Fix visibility when we have two types with explicit visibility in a template
argument list.
Modified:
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/test/CodeGenCXX/visibility.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=155368&r1=155367&r2=155368&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Mon Apr 23 12:51:55 2012
@@ -122,7 +122,7 @@
break;
case TemplateArgument::Type:
- LV.merge(getLVForType(Args[I].getAsType()));
+ LV.mergeWithMin(getLVForType(Args[I].getAsType()));
break;
case TemplateArgument::Declaration:
@@ -130,7 +130,7 @@
// arguments, valid only in C++0x.
if (Decl *D = Args[I].getAsDecl()) {
if (NamedDecl *ND = dyn_cast<NamedDecl>(D))
- LV.merge(getLVForDecl(ND, OnlyTemplate));
+ LV.mergeWithMin(getLVForDecl(ND, OnlyTemplate));
}
break;
@@ -138,7 +138,7 @@
case TemplateArgument::TemplateExpansion:
if (TemplateDecl *Template
= Args[I].getAsTemplateOrTemplatePattern().getAsTemplateDecl())
- LV.merge(getLVForDecl(Template, OnlyTemplate));
+ LV.mergeWithMin(getLVForDecl(Template, OnlyTemplate));
break;
case TemplateArgument::Pack:
Modified: cfe/trunk/test/CodeGenCXX/visibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/visibility.cpp?rev=155368&r1=155367&r2=155368&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/visibility.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/visibility.cpp Mon Apr 23 12:51:55 2012
@@ -700,3 +700,15 @@
// CHECK: define weak_odr void @_ZN6test353fooINS_3zedEE3barEv
// CHECK-HIDDEN: define weak_odr void @_ZN6test353fooINS_3zedEE3barEv
}
+
+namespace test36 {
+ template<typename T1, typename T2>
+ class foo {
+ void bar() {}
+ };
+ class DEFAULT S1 {};
+ struct HIDDEN S2 {};
+ template class foo<S1, S2>;
+ // CHECK: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
+ // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
+}
More information about the cfe-commits
mailing list