forked from OSchip/llvm-project
				
			Fix PR9941 again, this time for templates.
llvm-svn: 131640
This commit is contained in:
		
							parent
							
								
									ec0810e1c8
								
							
						
					
					
						commit
						8035d1c435
					
				| 
						 | 
				
			
			@ -8200,8 +8200,10 @@ void Sema::ActOnFields(Scope* S,
 | 
			
		|||
      const CXXDestructorDecl *Dtor =
 | 
			
		||||
              DelayedDestructorExceptionSpecChecks.back().first;
 | 
			
		||||
      if (Dtor->getParent() == Record) {
 | 
			
		||||
        CheckOverridingFunctionExceptionSpec(Dtor,
 | 
			
		||||
            DelayedDestructorExceptionSpecChecks.back().second);
 | 
			
		||||
        // Don't check if we're a template. The spec hasn't been adjusted.
 | 
			
		||||
        if (!Dtor->getParent()->isDependentType())
 | 
			
		||||
          CheckOverridingFunctionExceptionSpec(Dtor,
 | 
			
		||||
              DelayedDestructorExceptionSpecChecks.back().second);
 | 
			
		||||
        DelayedDestructorExceptionSpecChecks.pop_back();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -132,6 +132,10 @@ struct VX
 | 
			
		|||
struct VY : VX
 | 
			
		||||
{ virtual ~VY() {} };
 | 
			
		||||
 | 
			
		||||
template<typename T>
 | 
			
		||||
struct TVY : VX
 | 
			
		||||
{ virtual ~TVY() {} };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct VA {
 | 
			
		||||
  B b;
 | 
			
		||||
| 
						 | 
				
			
			@ -140,3 +144,28 @@ struct VA {
 | 
			
		|||
 | 
			
		||||
struct VB : VA
 | 
			
		||||
{ virtual ~VB() {} };
 | 
			
		||||
 | 
			
		||||
template<typename T>
 | 
			
		||||
struct TVB : VA
 | 
			
		||||
{ virtual ~TVB() {} };
 | 
			
		||||
 | 
			
		||||
void tinst2() {
 | 
			
		||||
  TVY<int> tvy;
 | 
			
		||||
  TVB<int> tvb;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <typename T>
 | 
			
		||||
struct Sw {
 | 
			
		||||
  T t;
 | 
			
		||||
  ~Sw() {}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void tsw() {
 | 
			
		||||
  Sw<int> swi;
 | 
			
		||||
  Sw<B> swb;
 | 
			
		||||
}
 | 
			
		||||
// CHECK-NOT: define linkonce_odr void @_ZN2SwI1BED1Ev({{.*}} nounwind
 | 
			
		||||
// CHECK: define linkonce_odr void @_ZN2SwI1BED1Ev({{.*}}
 | 
			
		||||
// CHECK: _ZTIi
 | 
			
		||||
// CHECK: __cxa_call_unexpected
 | 
			
		||||
// CHECK: define linkonce_odr void @_ZN2SwIiED1Ev({{.*}} nounwind
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue