Hahnfeld added inline comments.

================
Comment at: clang/lib/Driver/ToolChains/Cuda.cpp:209-211
+      Version = FS.exists(LibDevicePath + "/libdevice.10.bc")
+                    ? Version = CudaVersion::NEW
+                    : Version = CudaVersion::CUDA_70;
----------------
tra wrote:
> Hahnfeld wrote:
> > The compiler is now warning here because of the assignment to `VERSION` in 
> > the ternary operator
> I'll fix it shortly. I also need to figure out why my build does not produce 
> the warning. 
The exact warning is
```
LLVM/src/clang/lib/Driver/ToolChains/Cuda.cpp: In constructor 
‘clang::driver::CudaInstallationDetector::CudaInstallationDetector(const 
clang::driver::Driver&, const llvm::Triple&, const llvm::opt::ArgList&)’:       
       
LLVM/src/clang/lib/Driver/ToolChains/Cuda.cpp:207:15: warning: operation on 
‘((clang::driver::CudaInstallationDetector*)this)->clang::driver::CudaInstallationDetector::Version’
 may be undefined [-Wsequence-point]          
       Version = FS.exists(LibDevicePath + "/libdevice.10.bc")
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     ? Version = CudaVersion::NEW
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     : Version = CudaVersion::CUDA_70;
                     ~~~~~~~~~~~~~~~~~~~~~~~
```
Re-reading the code, I actually think this is a false positive of GCC 8.3.1 (on 
CentOS 8) and `Version` is never undefined. But it was redundant, so it's good 
to remove it anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108247/new/

https://reviews.llvm.org/D108247

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to