llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.63k stars 11.36k forks source link

error: no member named 'get' in the global namespace #98775

Closed kraj closed 1 month ago

kraj commented 1 month ago

With latest clang/main, seeing this error in compiling abseil-cpp from chromium using libc++ for runtime

clang version 19.0.0 (/home/kraj/work/llvm-project 1a4118f155f3446577cb0a93479d40fd8606a570)                                                                          Target: aarch64-unknown-linux

clang++ -target aarch64-linux hash.i -std=gnu++20

../../../../../git/src/3rdparty/chromium/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h:252:42: error: no member named 'get' in the global namespace
  252 |     return std::move(*this).StorageT<I>::get();
      |                                        ~~^
../../../../../git/src/3rdparty/chromium/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h:257:43: error: no member named 'get' in the global namespace
  257 |     return absl::move(*this).StorageT<I>::get();
      |                                         ~~^
2 errors generated.

hash.i.zip

llvmbot commented 1 month ago

@llvm/issue-subscribers-clang-frontend

Author: Khem Raj (kraj)

With latest clang/main, seeing this error in compiling abseil-cpp from chromium using libc++ for runtime ``` clang version 19.0.0 (/home/kraj/work/llvm-project 1a4118f155f3446577cb0a93479d40fd8606a570) Target: aarch64-unknown-linux ``` clang++ -target aarch64-linux hash.i -std=gnu++20 ``` ../../../../../git/src/3rdparty/chromium/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h:252:42: error: no member named 'get' in the global namespace 252 | return std::move(*this).StorageT<I>::get(); | ~~^ ../../../../../git/src/3rdparty/chromium/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h:257:43: error: no member named 'get' in the global namespace 257 | return absl::move(*this).StorageT<I>::get(); | ~~^ 2 errors generated. ``` [hash.i.zip](https://github.com/user-attachments/files/16203856/hash.i.zip)
mizvekov commented 1 month ago

This looks related to CWG1835, lastly implemented in https://github.com/llvm/llvm-project/pull/98547

Adding template keyword before Storage should fix it, but CWG1835 ended up being a very disruptive change, and in the future we will try make this a warning, not an error.

cor3ntin commented 1 month ago

Fixed by https://github.com/llvm/llvm-project/commit/59e56eeb1d9c0d25a522ae09f501a350981a31de