mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 04:07:10 +01:00 
			
		
		
		
	Remove redundant move to avoid Wredundant-move with Clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
		 Khem Raj
					Khem Raj
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							9bc15939a5
						
					
				
				
					commit
					799c7a2eed
				
			| @@ -42,14 +42,19 @@ namespace Catch { | ||||
|                 return createReporter(config->getReporterName(), config); | ||||
|             } | ||||
|  | ||||
|             auto multi = std::unique_ptr<ListeningReporter>(new ListeningReporter); | ||||
|  | ||||
|             // On older platforms, returning std::unique_ptr<ListeningReporter> | ||||
|             // when the return type is std::unique_ptr<IStreamingReporter> | ||||
|             // doesn't compile without a std::move call. However, this causes | ||||
|             // a warning on newer platforms. Thus, we have to work around | ||||
|             // it a bit and downcast the pointer manually. | ||||
|             auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); | ||||
|             auto& multi = static_cast<ListeningReporter&>(*ret); | ||||
|             auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); | ||||
|             for (auto const& listener : listeners) { | ||||
|                 multi->addListener(listener->create(Catch::ReporterConfig(config))); | ||||
|                 multi.addListener(listener->create(Catch::ReporterConfig(config))); | ||||
|             } | ||||
|             multi->addReporter(createReporter(config->getReporterName(), config)); | ||||
|             return std::move(multi); | ||||
|             multi.addReporter(createReporter(config->getReporterName(), config)); | ||||
|             return ret; | ||||
|         } | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user