mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Fix non-default-constructible type lists used in TEMPLATE_LIST_TEST_CASE (#1697)
* Fix non-default-constructible type lists used in TEMPLATE_LIST_TEST_CASE std::tuple is not default constructible when the first type is not default-constuctible. Therefore it can not be instantiated. to circumvent this, we have to use std::declval in the unevaluate decltype context.
This commit is contained in:
		 Benjamin Worpitz
					Benjamin Worpitz
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							a22b7df46c
						
					
				
				
					commit
					e7c26f09d1
				
			| @@ -247,7 +247,7 @@ struct AutoReg : NonCopyable { | ||||
|             }                                                     \ | ||||
|         };\ | ||||
|         static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ | ||||
|                 using TestInit = decltype(convert<TestName>(TmplList {})); \ | ||||
|                 using TestInit = decltype(convert<TestName>(std::declval<TmplList>())); \ | ||||
|                 TestInit t;                                           \ | ||||
|                 t.reg_tests();                                        \ | ||||
|                 return 0;                                             \ | ||||
| @@ -374,7 +374,7 @@ struct AutoReg : NonCopyable { | ||||
|                 }\ | ||||
|             };\ | ||||
|             static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ | ||||
|                 using TestInit = decltype(convert<TestNameClass>(TmplList {}));\ | ||||
|                 using TestInit = decltype(convert<TestNameClass>(std::declval<TmplList>()));\ | ||||
|                 TestInit t;\ | ||||
|                 t.reg_tests();\ | ||||
|                 return 0;\ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user