-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Don't use declarations in global namespace in stable headers #163352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use declarations in global namespace in stable headers #163352
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/163352
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 894b5e5 with merge base 33e6c5a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Fixes #163338 Follow up could be to configure https://clang.llvm.org/extra/clang-tidy/checks/google/global-names-in-headers.html for torch/csrc/stable [ghstack-poisoned]
Fixes #163338 Configured https://clang.llvm.org/extra/clang-tidy/checks/google/global-names-in-headers.html for torch/csrc/stable Note that doesn't error for the DeleterFnPtr case, but will generate the following for the `using torch::stable::Tensor;` ``` >>> Lint for torch/csrc/stable/ops.h: Error (CLANGTIDY) [google-global-names-in-headers,-warnings-as-errors] using declarations in the global namespace in headers are prohibited 10 |#include <torch/csrc/inductor/aoti_torch/generated/c_shim_aten.h> 11 |#include <torch/headeronly/core/ScalarType.h> 12 | >>> 13 |using torch::stable::Tensor; 14 | 15 |namespace torch::stable { 16 | ``` [ghstack-poisoned]
Fixes #163338 Configured https://clang.llvm.org/extra/clang-tidy/checks/google/global-names-in-headers.html for torch/csrc/stable Note that doesn't error for the DeleterFnPtr case, but will generate the following for the `using torch::stable::Tensor;` ``` >>> Lint for torch/csrc/stable/ops.h: Error (CLANGTIDY) [google-global-names-in-headers,-warnings-as-errors] using declarations in the global namespace in headers are prohibited 10 |#include <torch/csrc/inductor/aoti_torch/generated/c_shim_aten.h> 11 |#include <torch/headeronly/core/ScalarType.h> 12 | >>> 13 |using torch::stable::Tensor; 14 | 15 |namespace torch::stable { 16 | ``` [ghstack-poisoned]
janeyx99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…#163352) Fixes pytorch#163338 Configured https://clang.llvm.org/extra/clang-tidy/checks/google/global-names-in-headers.html for torch/csrc/stable Note that doesn't error for the DeleterFnPtr case, but will generate the following for the `using torch::stable::Tensor;` ``` >>> Lint for torch/csrc/stable/ops.h: Error (CLANGTIDY) [google-global-names-in-headers,-warnings-as-errors] using declarations in the global namespace in headers are prohibited 10 |#include <torch/csrc/inductor/aoti_torch/generated/c_shim_aten.h> 11 |#include <torch/headeronly/core/ScalarType.h> 12 | >>> 13 |using torch::stable::Tensor; 14 | 15 |namespace torch::stable { 16 | ``` Pull Request resolved: pytorch#163352 Approved by: https://github.com/janeyx99
…#163352) Fixes pytorch#163338 Configured https://clang.llvm.org/extra/clang-tidy/checks/google/global-names-in-headers.html for torch/csrc/stable Note that doesn't error for the DeleterFnPtr case, but will generate the following for the `using torch::stable::Tensor;` ``` >>> Lint for torch/csrc/stable/ops.h: Error (CLANGTIDY) [google-global-names-in-headers,-warnings-as-errors] using declarations in the global namespace in headers are prohibited 10 |#include <torch/csrc/inductor/aoti_torch/generated/c_shim_aten.h> 11 |#include <torch/headeronly/core/ScalarType.h> 12 | >>> 13 |using torch::stable::Tensor; 14 | 15 |namespace torch::stable { 16 | ``` Pull Request resolved: pytorch#163352 Approved by: https://github.com/janeyx99
…#163352) Fixes pytorch#163338 Configured https://clang.llvm.org/extra/clang-tidy/checks/google/global-names-in-headers.html for torch/csrc/stable Note that doesn't error for the DeleterFnPtr case, but will generate the following for the `using torch::stable::Tensor;` ``` >>> Lint for torch/csrc/stable/ops.h: Error (CLANGTIDY) [google-global-names-in-headers,-warnings-as-errors] using declarations in the global namespace in headers are prohibited 10 |#include <torch/csrc/inductor/aoti_torch/generated/c_shim_aten.h> 11 |#include <torch/headeronly/core/ScalarType.h> 12 | >>> 13 |using torch::stable::Tensor; 14 | 15 |namespace torch::stable { 16 | ``` Pull Request resolved: pytorch#163352 Approved by: https://github.com/janeyx99
Fixes #163338
Configured https://clang.llvm.org/extra/clang-tidy/checks/google/global-names-in-headers.html for torch/csrc/stable
Note that doesn't error for the DeleterFnPtr case, but will generate the following for the
using torch::stable::Tensor;Stack from ghstack (oldest at bottom):