File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,14 @@ AST_MATCHER(QualType, isIntegralType) {
96
96
97
97
AST_MATCHER_P (UserDefinedLiteral, hasLiteral,
98
98
clang::ast_matchers::internal::Matcher<Expr>, InnerMatcher) {
99
- if (const Expr *CookedLiteral = Node.getCookedLiteral ()) {
99
+ const UserDefinedLiteral::LiteralOperatorKind LOK =
100
+ Node.getLiteralOperatorKind ();
101
+ if (LOK == UserDefinedLiteral::LOK_Template ||
102
+ LOK == UserDefinedLiteral::LOK_Raw)
103
+ return false ;
104
+
105
+ if (const Expr *CookedLiteral = Node.getCookedLiteral ())
100
106
return InnerMatcher.matches (*CookedLiteral, Finder, Builder);
101
- }
102
107
return false ;
103
108
}
104
109
Original file line number Diff line number Diff line change @@ -376,6 +376,7 @@ Changes in existing checks
376
376
- Improved :doc: `readability-container-size-empty
377
377
<clang-tidy/checks/readability/container-size-empty>` check to prevent false
378
378
positives when utilizing ``size `` or ``length `` methods that accept parameter.
379
+ Fixed crash when facing template user defined literals.
379
380
380
381
- Improved :doc: `readability-duplicate-include
381
382
<clang-tidy/checks/readability/duplicate-include>` check by excluding include
Original file line number Diff line number Diff line change @@ -889,3 +889,9 @@ namespace PR88203 {
889
889
// CHECK-FIXES: {{^ }}if (s.empty()) {}{{$}}
890
890
}
891
891
}
892
+
893
+ namespace PR94454 {
894
+ template <char ...>
895
+ int operator " " _ci() { return 0 ; }
896
+ auto eq = 0_ci == 0 ;
897
+ }
You can’t perform that action at this time.
0 commit comments