Silence compiler warnings (#18912)
authorSebastian Messmer <messmer@fb.com>
Fri, 5 Apr 2019 08:46:58 +0000 (01:46 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 5 Apr 2019 08:52:00 +0000 (01:52 -0700)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18912

We intentionally test a deprecated API, no need to show the warnings here.

Reviewed By: dzhulgakov

Differential Revision: D14792617

fbshipit-source-id: 9ea2a4106d566064283726eed2c274b98f49a2e5

aten/src/ATen/core/op_registration/kernel_function_legacy_test.cpp
aten/src/ATen/core/op_registration/kernel_lambda_legacy_test.cpp

index a11c5a5..006870e 100644 (file)
  * >   .op("func(Tensor a) -> Tensor", &kernel);
  */
 
+// This intentionally tests a deprecated API
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 using c10::RegisterOperators;
 using c10::FunctionSchema;
 using c10::Argument;
@@ -839,3 +843,5 @@ TEST(OperatorRegistrationTest_LegacyFunctionBasedKernel, givenMismatchedKernel_w
 }
 
 }
+
+#pragma GCC diagnostic pop
index 7b62a86..5d1b6ba 100644 (file)
  * >    .op("myfunc(Tensor a) -> Tensor", [] (Tensor a) -> Tensor {...});
  */
 
+// This intentionally tests a deprecated API
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 using c10::RegisterOperators;
 using c10::FunctionSchema;
 using c10::Argument;
@@ -791,3 +795,5 @@ TEST(OperatorRegistrationTest_LegacyLambdaBasedKernel, givenMismatchedKernel_wit
 }
 
 }
+
+#pragma GCC diagnostic pop