Skip to content

[clang] Handle Binary StingLiteral kind in one more place #132201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

Fznamznon
Copy link
Contributor

The bots are upset by #127629 . Fix that.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Mar 20, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 20, 2025

@llvm/pr-subscribers-clang

Author: Mariya Podchishchaeva (Fznamznon)

Changes

The bots are upset by #127629 . Fix that.


Full diff: https://github.com/llvm/llvm-project/pull/132201.diff

1 Files Affected:

  • (modified) clang/lib/Sema/SemaExprCXX.cpp (+1)
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index f085facf7ff55..8f204b949cb2c 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -4143,6 +4143,7 @@ Sema::IsStringLiteralToNonConstPointerConversion(Expr *From, QualType ToType) {
             // We don't allow UTF literals to be implicitly converted
             break;
           case StringLiteralKind::Ordinary:
+          case StringLiteralKind::Binary:
             return (ToPointeeType->getKind() == BuiltinType::Char_U ||
                     ToPointeeType->getKind() == BuiltinType::Char_S);
           case StringLiteralKind::Wide:

@@ -4143,6 +4143,7 @@ Sema::IsStringLiteralToNonConstPointerConversion(Expr *From, QualType ToType) {
// We don't allow UTF literals to be implicitly converted
break;
case StringLiteralKind::Ordinary:
case StringLiteralKind::Binary:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That just brings to the state of before the patch with Binary literal. It seems the code is C++-specific, so I'm not sure what are the implications and if #embed can end up in the situation at all. Let me know if it better to revert the whole thing and think a bit more about it.

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming precommit CI is happy with it.

@Fznamznon Fznamznon merged commit 392b8f3 into llvm:main Mar 20, 2025
14 checks passed
Fznamznon added a commit to Fznamznon/llvm-project that referenced this pull request Mar 28, 2025
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants