Repository: pytorch
Issue: Issues with onnx package for pytorch build in WIndows 11
Labels: module: onnx,module: build,module: windows,triaged

### 🐛 Describe the bug

Pytorch 2.5.1 build with clang fails in Windows 11 with unknown type name errors for various onnx sub modules.

```
C:/Users/mcw/Documents/Jenet/pytorch/third_party/onnx/onnx/checker.h:148:27: error: unknown type name 'SequenceProto'
  148 | void check_sequence(const SequenceProto& sequence, const CheckerContext&);
      |                           ^
C:/Users/mcw/Documents/Jenet/pytorch/third_party/onnx/onnx/checker.h:149:22: error: unknown type name 'MapProto'
  149 | void check_map(const MapProto& map, const CheckerContext&);
      |                      ^
C:/Users/mcw/Documents/Jenet/pytorch/third_party/onnx/onnx/checker.h:150:27: error: unknown type name 'OptionalProto'
  150 | void check_optional(const OptionalProto& opt, const CheckerContext&);
      |                           ^
```    
 Versions:
Pytorch : 2.5.1
Clang: 19.1.3
ONNX module: 1.16.2     
    

### Versions

```
Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Home (10.0.22631 64-bit)
GCC version: (x86_64-win32-seh-rev0, Built by MinGW-Builds project) 14.2.0
Clang version: 19.1.3 (https://github.com/llvm/llvm-project.git ab51eccf88f5321e7c60591c5546b254b6afab99)
CMake version: version 3.31.0-rc2
Libc version: N/A

Python version: 3.11.7 | packaged by Anaconda, Inc. | (main, Dec 15 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22631-SP0
Is CUDA available: N/A
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

CPU:
Name: AMD Ryzen 5 9600X 6-Core Processor
Manufacturer: AuthenticAMD
Family: 107
Architecture: 9
ProcessorType: 3
DeviceID: CPU0
CurrentClockSpeed: 3900
MaxClockSpeed: 3900
L2CacheSize: 6144
L2CacheSpeed: None
Revision: 17408

Versions of relevant libraries:
[pip3] flake8==6.0.0
[pip3] mypy==1.8.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.24.4
[pip3] numpydoc==1.5.0
[pip3] onnx==1.16.0
[pip3] optree==0.13.1
[pip3] torch==2.1.2
[conda] _anaconda_depends         2024.02             py311_mkl_1
[conda] blas                      1.0                         mkl
[conda] mkl                       2023.1.0         h6b88ed4_46358
[conda] mkl-include               2025.0.1                 pypi_0    pypi
[conda] mkl-service               2.4.0           py311h2bbff1b_1
[conda] mkl-static                2025.0.1                 pypi_0    pypi
[conda] mkl_fft                   1.3.8           py311h2bbff1b_0
[conda] mkl_random                1.2.4           py311h59b6b97_0
[conda] numpy                     1.24.4                   pypi_0    pypi
[conda] numpydoc                  1.5.0           py311haa95532_0
[conda] optree                    0.13.1                   pypi_0    pypi
[conda] torch                     2.1.2                    pypi_0    pypi
```

cc @malfet @seemethere @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex