File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ struct UnqualNameVisitor : public RecursiveASTVisitor<UnqualNameVisitor> {
103
103
104
104
bool VisitDeclRefExpr (DeclRefExpr *S) {
105
105
DeclarationName Name = S->getNameInfo ().getName ();
106
- return S->getQualifierLoc () || !Name.isIdentifier () ||
106
+ return S->getQualifierLoc () || Name. isEmpty () || !Name.isIdentifier () ||
107
107
!visitUnqualName (Name.getAsIdentifierInfo ()->getName ());
108
108
}
109
109
Original file line number Diff line number Diff line change @@ -98,3 +98,21 @@ struct TestDefaultOperatorB {
98
98
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
99
99
// CHECK-FIXES: {{^}} friend auto operator<(const TestDefaultOperatorB &, const TestDefaultOperatorB &) noexcept -> bool = default;{{$}}
100
100
};
101
+
102
+ namespace PR69863 {
103
+
104
+ template <unsigned Len>
105
+ struct CustomCompileTimeString {
106
+ constexpr CustomCompileTimeString (const char (&)[Len]) noexcept {}
107
+ };
108
+
109
+ template <CustomCompileTimeString Str>
110
+ constexpr decltype (Str) operator""__csz() noexcept {
111
+ // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
112
+ // CHECK-FIXES: {{^}}constexpr auto operator""__csz() noexcept -> decltype(Str) {
113
+ return Str;
114
+ }
115
+
116
+ inline constexpr CustomCompileTimeString SomeString = " This line will cause a crash" __csz;
117
+
118
+ }
You can’t perform that action at this time.
0 commit comments