Skip to content

Commit

Permalink
Bug fix in clang for not constant folding unevaluated strings in attr…
Browse files Browse the repository at this point in the history
…ibutes.
  • Loading branch information
pgoodman committed Sep 26, 2023
1 parent bf9d04a commit 356c39c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions clang/lib/Sema/SemaAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,13 @@ bool Sema::ConstantFoldAttrArgs(const AttributeCommonInfo &CI,
if (E->isValueDependent() || E->isTypeDependent())
continue;

// Unevaluated string literal in attributes.
//
// XREF: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2361r0.pdf
if (auto SL = dyn_cast<StringLiteral>(E))
if (SL->isUnevaluated())
continue;

// FIXME: Use DefaultFunctionArrayLValueConversion() in place of the logic
// that adds implicit casts here.
if (E->getType()->isArrayType())
Expand Down

0 comments on commit 356c39c

Please sign in to comment.