File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,11 @@ public override bool VisitFieldDecl(Field field)
7878 if ( ! base . VisitDeclaration ( field ) )
7979 return false ;
8080
81- CheckForInternalSpecialization ( field , field . Type ) ;
81+ if ( field . Access == AccessSpecifier . Private ||
82+ ! ASTUtils . CheckTypeForSpecialization ( field . Type ,
83+ field , AddSpecialization , Context . TypeMaps ) )
84+ CheckForInternalSpecialization ( field , field . Type ) ;
85+
8286 return true ;
8387 }
8488
Original file line number Diff line number Diff line change @@ -871,6 +871,20 @@ public void TestTemplateDerivedFromRegularDynamic()
871871 }
872872 }
873873
874+ [ Test ]
875+ public void TestFieldWithSpecializationType ( )
876+ {
877+ using ( var virtualTemplate = new VirtualTemplate < int > ( ) )
878+ {
879+ using ( var dependentValueFields = new DependentValueFields < float > ( ) )
880+ {
881+ dependentValueFields . DependentValue = 15 ;
882+ virtualTemplate . FieldWithSpecializationType = dependentValueFields ;
883+ Assert . That ( virtualTemplate . FieldWithSpecializationType . DependentValue , Is . EqualTo ( 15 ) ) ;
884+ }
885+ }
886+ }
887+
874888 [ Test ]
875889 public void TestAbstractImplementatonsInPrimaryAndSecondaryBases ( )
876890 {
Original file line number Diff line number Diff line change @@ -388,6 +388,7 @@ class VirtualTemplate
388388 VirtualTemplate (OptionalTemplateArgs<T> optionalTemplateArgs);
389389 virtual ~VirtualTemplate ();
390390 virtual int function ();
391+ DependentValueFields<float > fieldWithSpecializationType;
391392};
392393
393394template <typename T>
@@ -569,6 +570,7 @@ template class DLL_API IndependentFields<T1>;
569570template class DLL_API IndependentFields<std::string>;
570571template class DLL_API Base<int >;
571572template class DLL_API DependentValueFields<int >;
573+ template class DLL_API DependentValueFields<float >;
572574template class DLL_API VirtualTemplate<int >;
573575template class DLL_API VirtualTemplate<bool >;
574576template class DLL_API HasDefaultTemplateArgument<int , int >;
You can’t perform that action at this time.
0 commit comments