ojhunt wrote:
The docs failure is #142387
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik approved this pull request.
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ojhunt wrote:
I can't reproduce this locally so I've ensured my tree is up to date and
pushing again to see if it fails again
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/141148
>From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 22 May 2025 02:38:26 -0700
Subject: [PATCH 1/5] [clang] Correct FixIt ranges for unused capture warnings
Fixes
@@ -972,6 +972,12 @@ class Sema final : public SemaBase {
/// Calls \c Lexer::getLocForEndOfToken()
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0);
+ /// Calls \c Lexer::findNextToken() to find the next token, and if the
+ /// locations of bo
ojhunt wrote:
> Documentation failure says:
>
> Warning, treated as error:
> /home/runner/work/llvm-project/llvm-project/clang-build/tools/clang/docs/DiagnosticsReference.rst:18009:Unexpected
> indentation.
Right, but I don't know how/what is causing the failure as I haven't changed
any dia
erichkeane wrote:
> I don't understand the windows failure (ninja says there was a failure, but I
> cannot find any failure in the log?)
>
> I'm also confused by the documentation failure: it's not telling me
> what/where the error is coming from.
Documentation failure says:
Warning, treat
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/141148
>From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 22 May 2025 02:38:26 -0700
Subject: [PATCH 1/5] [clang] Correct FixIt ranges for unused capture warnings
Fixes
ojhunt wrote:
I don't understand the windows failure (ninja says there was a failure, but I
cannot find any failure in the log?)
I'm also confused by the documentation failure: it's not telling me what/where
the error is coming from.
https://github.com/llvm/llvm-project/pull/141148
__
@@ -1,5 +1,5 @@
// RUN: cp %s %t
-// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z
-fixit %t
+// RUN: %clang_cc1 -x c++ -Wno-vla-cxx-extension -Wunused-lambda-capture
-Wno-unused-value -std=c++1z -fixit %t
ojhunt wrote:
ah no, th
@@ -1,5 +1,5 @@
// RUN: cp %s %t
-// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z
-fixit %t
+// RUN: %clang_cc1 -x c++ -Wno-vla-cxx-extension -Wunused-lambda-capture
-Wno-unused-value -std=c++1z -fixit %t
cor3ntin wrote:
Why is
@@ -2095,6 +2101,39 @@ FieldDecl *Sema::BuildCaptureField(RecordDecl *RD,
return Field;
}
+static SourceRange
+constructFixItRangeForUnusedCapture(Sema &S, SourceRange CaptureRange,
cor3ntin wrote:
```suggestion
ConstructFixItRangeForUnusedCapture(Sema &S,
@@ -84,6 +84,29 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange
+Sema::getRangeForNextToken(SourceLocation Loc, bool IncludeMacros,
+
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+ bool
https://github.com/cor3ntin edited
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/cor3ntin approved this pull request.
LGTM modulo nitpicks
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/141148
>From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 22 May 2025 02:38:26 -0700
Subject: [PATCH 1/4] [clang] Correct FixIt ranges for unused capture warnings
Fixes
@@ -0,0 +1,250 @@
+// RUN: cp %s %t
+// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z
-fixit %t
+// RUN: grep -v CHECK %t | FileCheck %s
+
+
+#define MACRO_CAPTURE(...) __VA_ARGS__
+int main() {
+int a = 0, b = 0, c = 0;
+auto F0 = [a, &b]()
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/141148
>From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 22 May 2025 02:38:26 -0700
Subject: [PATCH 1/4] [clang] Correct FixIt ranges for unused capture warnings
Fixes
@@ -2164,15 +2164,29 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation
StartLoc, SourceLocation EndLoc,
bool IsLast = (I + 1) == LSI->NumExplicitCaptures;
SourceRange FixItRange;
if (CaptureRange.isValid()) {
+auto GetTrailingEndLocat
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/141148
>From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 22 May 2025 02:38:26 -0700
Subject: [PATCH 1/3] [clang] Correct FixIt ranges for unused capture warnings
Fixes
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -972,6 +972,12 @@ class Sema final : public SemaBase {
/// Calls \c Lexer::getLocForEndOfToken()
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0);
+ /// Calls \c Lexer::findNextToken() to find the next token, and if the
+ /// locations of bo
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ojhunt edited
https://github.com/llvm/llvm-project/pull/141148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+ bool
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h --
clang/test/FixIt/fixit-unused-lambda-capture-traili
https://github.com/ojhunt updated
https://github.com/llvm/llvm-project/pull/141148
>From 0db205bb8f6925dd725885395f58a688000c7b8b Mon Sep 17 00:00:00 2001
From: Oliver Hunt
Date: Thu, 22 May 2025 02:38:26 -0700
Subject: [PATCH 1/2] [clang] Correct FixIt ranges for unused capture warnings
Fixes
@@ -972,6 +972,12 @@ class Sema final : public SemaBase {
/// Calls \c Lexer::getLocForEndOfToken()
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0);
+ /// Calls \c Lexer::findNextToken() to find the next token, and if the
+ /// locations of bo
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+ bool
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+ bool
@@ -2164,15 +2164,29 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation
StartLoc, SourceLocation EndLoc,
bool IsLast = (I + 1) == LSI->NumExplicitCaptures;
SourceRange FixItRange;
if (CaptureRange.isValid()) {
+auto GetTrailingEndLocat
@@ -972,6 +972,12 @@ class Sema final : public SemaBase {
/// Calls \c Lexer::getLocForEndOfToken()
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0);
+ /// Calls \c Lexer::findNextToken() to find the next token, and if the
+ /// locations of bo
@@ -0,0 +1,250 @@
+// RUN: cp %s %t
+// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z
-fixit %t
+// RUN: grep -v CHECK %t | FileCheck %s
+
+
+#define MACRO_CAPTURE(...) __VA_ARGS__
+int main() {
+int a = 0, b = 0, c = 0;
+auto F0 = [a, &b]()
@@ -972,6 +972,12 @@ class Sema final : public SemaBase {
/// Calls \c Lexer::getLocForEndOfToken()
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0);
+ /// Calls \c Lexer::findNextToken() to find the next token, and if the
+ /// locations of bo
@@ -0,0 +1,250 @@
+// RUN: cp %s %t
+// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z
-fixit %t
+// RUN: grep -v CHECK %t | FileCheck %s
+
+
+#define MACRO_CAPTURE(...) __VA_ARGS__
+int main() {
+int a = 0, b = 0, c = 0;
+auto F0 = [a, &b]()
@@ -2164,15 +2164,29 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation
StartLoc, SourceLocation EndLoc,
bool IsLast = (I + 1) == LSI->NumExplicitCaptures;
SourceRange FixItRange;
if (CaptureRange.isValid()) {
+auto GetTrailingEndLocat
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+ bool
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+ bool
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+ bool
cor3ntin wrote:
This change needs a release note.
Please add an entry to `clang/docs/ReleaseNotes.rst` in the section the most
adapted to the change, and referencing any Github issue this change fixes.
Thanks!
https://github.com/llvm/llvm-project/pull/141148
___
@@ -84,6 +84,21 @@ SourceLocation Sema::getLocForEndOfToken(SourceLocation Loc,
unsigned Offset) {
return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
}
+SourceRange Sema::getRangeForNextToken(SourceLocation Loc,
+ bool
@@ -2164,15 +2164,29 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation
StartLoc, SourceLocation EndLoc,
bool IsLast = (I + 1) == LSI->NumExplicitCaptures;
SourceRange FixItRange;
if (CaptureRange.isValid()) {
+auto GetTrailingEndLocat
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Oliver Hunt (ojhunt)
Changes
Fixes #106445 by using the lexer to find the correct range for the
removal FixIts. Previously the ranges that were generated assuming no
unsurprising formatting, which for the most part works. Being correct in
https://github.com/ojhunt created
https://github.com/llvm/llvm-project/pull/141148
Fixes #106445 by using the lexer to find the correct range for the removal
FixIts. Previously the ranges that were generated assuming no unsurprising
formatting, which for the most part works. Being correct in a
46 matches
Mail list logo