mirror of
				https://github.com/pytorch/pytorch.git
				synced 2025-11-04 16:04:58 +08:00 
			
		
		
		
	[BE] Enforce missing override keyword (#104032)
				
					
				
			This PR enables `-Winconsistent-missing-destructor-override` and `-Winconsistent-missing-override` and fixes violations. <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 47e904e</samp> This pull request updates the code of various classes and operators in the `caffe2` and `aten` subdirectories to use the `override` specifier instead of the `virtual` keyword for destructors and other virtual functions that override a base class function. This improves the code readability, quality, and consistency with C++ best practices. It also modifies the `./CMakeLists.txt` file to enable warnings for these specifiers, but disable errors. Pull Request resolved: https://github.com/pytorch/pytorch/pull/104032 Approved by: https://github.com/malfet
This commit is contained in:
		@ -68,8 +68,7 @@ class BackendWithCompiler : public PyTorchBackendInterface {
 | 
			
		||||
  // Constructor.
 | 
			
		||||
  // NOLINTNEXTLINE(modernize-use-equals-default)
 | 
			
		||||
  explicit BackendWithCompiler() {}
 | 
			
		||||
  // NOLINTNEXTLINE(modernize-use-override)
 | 
			
		||||
  virtual ~BackendWithCompiler() = default;
 | 
			
		||||
  virtual ~BackendWithCompiler() override = default;
 | 
			
		||||
 | 
			
		||||
  bool is_available() override {
 | 
			
		||||
    return true;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user