[Clang] [[gnu::weak, gnu::ifunc]] isn't diagnosed
Open
accepts-invalid
clang:frontend
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Using both `[[gnu::weak]]` and `[[gnu::ifunc]]` is not supported. However, Clang silently drops the `[[gnu::weak]]` part instead of diagnosing the issue like GCC does.
For completeness, here is a simple reproducer:
```c++
extern "C" void* resolver() {
return nullptr;
}
[[gnu::weak, gnu::ifunc("resolver")]] void selector();
```
Contributor guide
Research direction
Start by compiling the provided C++ reproducer in Clang and tracing how the [[gnu::weak]] and [[gnu::ifunc]] attributes are handled. Done means Clang diagnoses their unsupported combination instead of silently dropping [[gnu::weak]], matching GCC's behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100