llvm / llvm/llvm-project

String literal concatenations which mix different encoding prefixes are incorrectly accepted in ignored attributes

Open
#188,867 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepts-invalid clang:frontend confirmed
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The following program demonstrates the issue:
```c
[[unknown::attribute(L""U"")]]int main(){}
```
The concatenation of the string literals `L""` and `U""` is invalid. In C++ the same issue exists, but a space is needed between the string literals. Only EDG gets this correct. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124655

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the C reproducer in the issue and compare how Clang handles the same mixed-prefix concatenation in C++ when a space is present. Trace parsing and validation for ignored attributes, then add regression coverage showing that incompatible string literal encoding prefixes are rejected in both forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.