Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ AST_MATCHER(QualType, isIntegralType) {

AST_MATCHER_P(UserDefinedLiteral, hasLiteral,
clang::ast_matchers::internal::Matcher<Expr>, InnerMatcher) {
if (const Expr *CookedLiteral = Node.getCookedLiteral()) {
const UserDefinedLiteral::LiteralOperatorKind LOK =
Node.getLiteralOperatorKind();
if (LOK == UserDefinedLiteral::LOK_Template ||
LOK == UserDefinedLiteral::LOK_Raw)
return false;

if (const Expr *CookedLiteral = Node.getCookedLiteral())
return InnerMatcher.matches(*CookedLiteral, Finder, Builder);
}
return false;
}

Expand Down
1 change: 1 addition & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ Changes in existing checks
- Improved :doc:`readability-container-size-empty
<clang-tidy/checks/readability/container-size-empty>` check to prevent false
positives when utilizing ``size`` or ``length`` methods that accept parameter.
Fixed crash when facing template user defined literals.

- Improved :doc:`readability-duplicate-include
<clang-tidy/checks/readability/duplicate-include>` check by excluding include
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -889,3 +889,9 @@ namespace PR88203 {
// CHECK-FIXES: {{^ }}if (s.empty()) {}{{$}}
}
}

namespace PR94454 {
template <char...>
int operator""_ci() { return 0; }
auto eq = 0_ci == 0;
}