llvm / llvm/llvm-project

[clang] Clang should warn for ignored result of string literals operators

Open
#169,315 2 comments 0 reactions 0 assignees View on GitHub
clang:diagnostics
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

This came up during a review: https://github.com/llvm/llvm-project/pull/169010#discussion_r2555372077

Maybe Clang should warn when `string` and `string_view` literals operator result is unused:

```c++
""s;
L""s;

""sv;
L""sv;
```

Contributor guide

Open the contributing guide

Research direction

The issue targets Clang and the unused results of the four shown string and string_view literal expressions. First confirm how Clang currently treats these expressions and identify the relevant diagnostic and test locations; done means Clang consistently warns for the intended cases without changing unrelated unused-expression behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.