[clang] [coroutines] Introduce [[clang::coro_return_type]] and [[clang::coro_wrapper]] (PR #71945)

2023-11-17 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/71945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutines] Introduce [[clang::coro_return_type]] and [[clang::coro_wrapper]] (PR #71945)

2023-11-17 Thread Ilya Biryukov via cfe-commits
@@ -15811,6 +15813,20 @@ static void diagnoseImplicitlyRetainedSelf(Sema &S) { << FixItHint::CreateInsertion(P.first, "self->"); } +void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { + if (!FD || getCurFunction()->isCoroutine()) ilya-biryukov wrot

[clang] [coroutines] Introduce [[clang::coro_return_type]] and [[clang::coro_wrapper]] (PR #71945)

2023-11-17 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. LGTM assuming the `getCurFunction()` comment is addressed in some form (moving it to callers or adding an assertion) Thanks for the change! https://github.com/llvm/llvm-project/pull/71945 _

[clang] [coroutines] Introduce [[clang::coro_lifetimebound]] (PR #72851)

2023-11-21 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. LGTM with a few suggestiosn. One is in the comment. I also suggest to add a warning when users mark the type as `coro_lifetimebound` without `coro_return_type`. The analysis will be disabled in this case and it may be hard to understa

[clang] [coroutines] Introduce [[clang::coro_lifetimebound]] (PR #72851)

2023-11-21 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/72851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutines] Introduce [[clang::coro_lifetimebound]] (PR #72851)

2023-11-21 Thread Ilya Biryukov via cfe-commits
@@ -334,6 +334,10 @@ Attribute Changes in Clang [[clang::code_align(A)]] for(;;) { } } +- Clang now introduced ``[[clang::coro_lifetimebound]]`` attribute. + All arguments to a function are considered to be lifetime bound if the function ilya-b

[clang-tools-extra] [clangd] Perform self-containedness check at EOF (PR #75965)

2023-12-20 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: Thanks a lot! This fixes the problem we encountered with ranking includes. https://github.com/llvm/llvm-project/pull/75965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang-tools-extra] [clangd] Perform self-containedness check at EOF (PR #75965)

2023-12-20 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. https://github.com/llvm/llvm-project/pull/75965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Perform self-containedness check at EOF (PR #75965)

2023-12-20 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/75965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-21 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: I wanted to mention that it is critical to have an incremental path to introduce these warnings for our release process at Google. I hope this is in line with Clang's needs and not too disturbing to the upstream development. It also helps people with similar needs, i.e. th

[clang] [clang-tools-extra] [llvm] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

2023-12-21 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/74490 >From 51d6e95d67c3cc6070d926ef04b168c2ea429c7d Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Tue, 5 Dec 2023 14:28:01 +0100 Subject: [PATCH 1/2] [Sema] When checking for constraint equivalence, do not

[clang] [clang-tools-extra] [llvm] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

2023-12-21 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/74490 >From 51d6e95d67c3cc6070d926ef04b168c2ea429c7d Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Tue, 5 Dec 2023 14:28:01 +0100 Subject: [PATCH 1/3] [Sema] When checking for constraint equivalence, do not

[clang-tools-extra] [clang] [llvm] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

2023-12-21 Thread Ilya Biryukov via cfe-commits
@@ -4077,6 +4084,7 @@ Sema::SubstExpr(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs) { TemplateInstantiator Instantiator(*this, TemplateArgs, SourceLocation(), DeclarationName()); + Instan

[clang] 95b423e - [Sema] NFC. Simplify code in a few places of TryOrBuildParenListInitialization

2023-12-22 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2023-12-22T12:41:52+01:00 New Revision: 95b423e44f6f35651bb1e7d4f6e0591df71360af URL: https://github.com/llvm/llvm-project/commit/95b423e44f6f35651bb1e7d4f6e0591df71360af DIFF: https://github.com/llvm/llvm-project/commit/95b423e44f6f35651bb1e7d4f6e0591df71360af.diff

[clang] [Sema] Fix crash on invalid code with parenthesized aggregate initialization (PR #76232)

2023-12-22 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/76232 Fixes #76228. Use the same logic as braced init lists, also adds a test that puts incomplete types in various positions to check for regressions in the future. >From 491f3b09a2064c82c1646ca1d0c2987478bb4f5

[clang] [Sema] Fix crash on invalid code with parenthesized aggregate initialization (PR #76232)

2023-12-22 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/76232 >From 491f3b09a2064c82c1646ca1d0c2987478bb4f51 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Fri, 22 Dec 2023 12:33:34 +0100 Subject: [PATCH 1/2] [Sema] Fix crash on invalid code with parenthesized ag

[clang] [Sema] Fix crash on invalid code with parenthesized aggregate initialization (PR #76232)

2023-12-22 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/76232 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7ab16fb - [Sema] Update test for previous change

2023-12-22 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2023-12-22T13:30:43+01:00 New Revision: 7ab16fb5207fe187ab999f882069bd632d2e68e5 URL: https://github.com/llvm/llvm-project/commit/7ab16fb5207fe187ab999f882069bd632d2e68e5 DIFF: https://github.com/llvm/llvm-project/commit/7ab16fb5207fe187ab999f882069bd632d2e68e5.diff

[clang] [clang-format] Do not break on JS fields like on goto labels (PR #76233)

2023-12-22 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/76233 This regressions was introduced in 70d7ea0cebcf363cd0ddcfb76375fb5fada87dd5. The commit moved some code and correctly picked up an explicit check for not running on Verilog. However, the moved code also ne

[clang] [clang-format] Do not break on JS fields like on goto labels (PR #76233)

2023-12-22 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: There is no way for me to fix the formatting presubmit as it can't run on new clang-format code. Submitting as is. https://github.com/llvm/llvm-project/pull/76233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [clang-format] Do not break on JS fields like on goto labels (PR #76233)

2023-12-22 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/76233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add common attribute macros to Google style (PR #76239)

2023-12-22 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/76239 We have found that 199fc973ced20016b04ba540cf63a1d4914fa513 regresses formatting of our codebases because we do not properly configure the names of attribute macros. `GUARDED_BY` and `ABSL_GUARDED_BY` are

[clang] [clang-format] Add common attribute macros to Google style (PR #76239)

2023-12-22 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/76239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix crash on invalid code with parenthesized aggregate initialization (PR #76232)

2024-01-02 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: Thanks for reverting it and sorry for the trouble, I will make sure to check libc++ tests before a reland. Clang does report less errors now, but that's expected. The errors were spurious, caused by Clang trying to initialize an "invalid" class (more details below in case

[clang] [clang-format] Add common attribute macros to Google style (PR #76239)

2024-01-02 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: This change did not aim to change the behavior, it's quite the opposite, I tried to guide `clang-format` parsing to recognize attribute and format the code in the way we always intended it to. If there is a way to do that without adding the macro names to the configuratio

[clang] 02347fc - Reapply "[Sema] Fix crash on invalid code with parenthesized aggregate initialization" (#76272)

2024-01-02 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2024-01-02T16:00:55+01:00 New Revision: 02347fc7191ff4d073f439dde6523add3f5496de URL: https://github.com/llvm/llvm-project/commit/02347fc7191ff4d073f439dde6523add3f5496de DIFF: https://github.com/llvm/llvm-project/commit/02347fc7191ff4d073f439dde6523add3f5496de.diff

[clang] [clang-tools-extra] [coroutines] Do not check coroutine wrappers for skipped function bodies (PR #76729)

2024-01-02 Thread Ilya Biryukov via cfe-commits
@@ -15845,7 +15845,7 @@ static void diagnoseImplicitlyRetainedSelf(Sema &S) { } void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { - if (!FD) + if (!FD || FD->hasSkippedBody()) ilya-biryukov wrote: Suggestion: a comment would be appropriate here, e.g. `//

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-03 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/76804 This addresses a problem with formatting attributes. Some context: - 199fc973ced20016b04ba540cf63a1d4914fa513 changed `isStartOfName` to fix problems inside macro directives (judging by the added tests), bu

[clang] [clang-format] Fix more bugs in isStartOfName() (PR #72336)

2024-01-03 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: I have played around with specializing new behavior to macro directives and it seems work well, I have sent #76804 for review. https://github.com/llvm/llvm-project/pull/72336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-03 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/76804 >From d8598a382fb1496a96d6ff8317c06cf73606ad84 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 3 Jan 2024 11:07:17 +0100 Subject: [PATCH 1/2] [Format] Fix isStartOfName to recognize attributes This

[clang] [clang-tools-extra] [coroutines] Do not check coroutine wrappers for skipped function bodies (PR #76729)

2024-01-03 Thread Ilya Biryukov via cfe-commits
@@ -15845,7 +15845,7 @@ static void diagnoseImplicitlyRetainedSelf(Sema &S) { } void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { - if (!FD) + if (!FD || FD->hasSkippedBody()) ilya-biryukov wrote: Nice! Thanks, this definitely looks much better now! htt

[clang] [clang-tools-extra] [coroutines] Do not check coroutine wrappers for skipped function bodies (PR #76729)

2024-01-03 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. https://github.com/llvm/llvm-project/pull/76729 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutines] Introduce [[clang::coro_not_lifetimebound]] (PR #76818)

2024-01-03 Thread Ilya Biryukov via cfe-commits
@@ -1121,6 +1121,14 @@ def CoroLifetimeBound : InheritableAttr { let SimpleHandler = 1; } +def CoroNotLifetimeBound : InheritableAttr { ilya-biryukov wrote: Any alternatives to this name? Maybe `coro_disable_lifetime_bound`? The current name confused me a

[clang] [coroutines] Introduce [[clang::coro_not_lifetimebound]] (PR #76818)

2024-01-03 Thread Ilya Biryukov via cfe-commits
@@ -115,3 +115,18 @@ CoNoCRT bar(int a) { co_return 1; } } // namespace not_a_crt + +// = +// Not lifetime bound coroutine wrappers: [[clang::coro_not_lifetimebound]]. +// ==

[clang] [coroutines] Introduce [[clang::coro_not_lifetimebound]] (PR #76818)

2024-01-03 Thread Ilya Biryukov via cfe-commits
@@ -7671,9 +7671,12 @@ The ``[[clang::coro_lifetimebound]]`` is a class attribute which can be applied to a coroutine return type (`CRT`_) (i.e. it should also be annotated with ``[[clang::coro_return_type]]``). -All parameters of a function are considered to be lifetime boun

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-03 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > can you also add a test to clang/unittests/Format/TokenAnnotatorTest.cpp that > ensures trailing attribute-like macros receive `StartOfName` annotation to > make sure we don't regress the signal in the future? ok, that opened a whole can of worms. ``` Tokens = annotate(

[clang] 55d5ba9 - [NFC] Fix compilation in C++20 mode with GCC 12

2024-01-03 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2024-01-03T17:02:00+01:00 New Revision: 55d5ba905da0db55282dd3985761ddf3dd452fd1 URL: https://github.com/llvm/llvm-project/commit/55d5ba905da0db55282dd3985761ddf3dd452fd1 DIFF: https://github.com/llvm/llvm-project/commit/55d5ba905da0db55282dd3985761ddf3dd452fd1.diff

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-04 Thread Ilya Biryukov via cfe-commits
@@ -10093,11 +10090,11 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) { getGoogleStyleWithColumns(40)); verifyFormat("Tttt ppp\n" "ABSL_GUARDED_BY(mutex1)\n" - "ABSL_GUARDED_BY(mutex2);", +

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-04 Thread Ilya Biryukov via cfe-commits
@@ -1698,8 +1698,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { /*BasedOnStyle=*/"google", }, }; - GoogleStyle.AttributeMacros.push_back("GUARDED_BY"); ilya-biryukov wrote: They are attribute macros indeed, the proble

[llvm] [clang] [libcxx] "Reapply "[Sema] Fix crash on invalid code with parenthesized aggrega… (PR #76833)

2024-01-04 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > @ilya-biryukov this is the new attempt to land this patch, the version you > committed breaks the libc++ CI. I'll try to fix it this week. Wow, I didn't expect that. Is libc++ ok with disabling this test until the nightly build catches up? (The PR is in the Draft state,

[clang-tools-extra] [clang] [llvm] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

2024-01-04 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/74490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-01-04 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: I'm Sam's colleague and wanted to mention that Sam won't be available until January 15. It probably does not make much sense for someone else to take over at this point as the change is large and waiting for Sam is more efficient than ramping up someone else at this point.

[clang] [coroutines] Introduce [[clang::coro_disable_lifetimebound]] (PR #76818)

2024-01-05 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. I agree we could add parameter attributes later! LGTM! https://github.com/llvm/llvm-project/pull/76818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [llvm] [libcxx] "Reapply "[Sema] Fix crash on invalid code with parenthesized aggrega… (PR #76833)

2024-01-05 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > It's not ideal, but I can't think of a better solution. Typically nightly apt > builds are built nightly so then we can update the Docker CI quickly. If the > nightly builds are red it might take a bit longer. > The patch is in draft since I wanted to test with the bootst

[clang] [clang] Bounds checking on unclosed parentheses, brackets or braces in Expanded Tokens (PR #69849)

2024-01-08 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: I second everything that @HighCommander4 said. It would be really useful to add an assertion that we never get out-of-bounds here, but this indicates a logic error somewhere in the code that should be fixed. I am slightly suspicious of source locations pointing at `eof` in

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-08 Thread Ilya Biryukov via cfe-commits
@@ -1698,8 +1698,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { /*BasedOnStyle=*/"google", }, }; - GoogleStyle.AttributeMacros.push_back("GUARDED_BY"); ilya-biryukov wrote: @HazardyKnusperkeks friendly ping. Any thoug

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-08 Thread Ilya Biryukov via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-08 Thread Ilya Biryukov via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-08 Thread Ilya Biryukov via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [AST] Teach TextNodeDumper to print the "implicit" bit for coroutine AST nodes (PR #77311)

2024-01-08 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. LGTM, other nodes also do this. But please take a look at suggestions for improving the test before landing. https://github.com/llvm/llvm-project/pull/77311 ___ cfe-commits mailing list cfe-c

[clang] [AST] Teach TextNodeDumper to print the "implicit" bit for coroutine AST nodes (PR #77311)

2024-01-08 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/77311 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Teach TextNodeDumper to print the "implicit" bit for coroutine AST nodes (PR #77311)

2024-01-08 Thread Ilya Biryukov via cfe-commits
@@ -0,0 +1,46 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -std=c++20 \ +// RUN:-fsyntax-only -ast-dump -ast-dump-filter test | FileCheck %s + +#include "Inputs/std-coroutine.h" + +using namespace std; + +struct Task { + struct promise_type { +std::suspend_alw

[clang] 42f87bb - [Sema] Return primary merged decl as canonical for concepts

2022-07-27 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-07-27T12:31:20+02:00 New Revision: 42f87bb62d0719848842da60d2a8180b9e4d7c52 URL: https://github.com/llvm/llvm-project/commit/42f87bb62d0719848842da60d2a8180b9e4d7c52 DIFF: https://github.com/llvm/llvm-project/commit/42f87bb62d0719848842da60d2a8180b9e4d7c52.diff

[clang] 0752999 - [Sema] Merge variable template specializations

2022-08-09 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-08-09T12:17:41+02:00 New Revision: 07529996d92b9fc0cc760f4e98d88b607f66e747 URL: https://github.com/llvm/llvm-project/commit/07529996d92b9fc0cc760f4e98d88b607f66e747 DIFF: https://github.com/llvm/llvm-project/commit/07529996d92b9fc0cc760f4e98d88b607f66e747.diff

[clang] 75e16fd - [Index] [clangd] Support for concept declarations and requires expressions

2022-04-26 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-04-26T13:50:01Z New Revision: 75e16fd2c656fb7d27e6edc46dc1a63ff8323999 URL: https://github.com/llvm/llvm-project/commit/75e16fd2c656fb7d27e6edc46dc1a63ff8323999 DIFF: https://github.com/llvm/llvm-project/commit/75e16fd2c656fb7d27e6edc46dc1a63ff8323999.diff LOG:

[clang-tools-extra] 2b833d4 - [AST] Improve traversal of concepts and concept requirements

2022-04-28 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-04-28T09:33:26Z New Revision: 2b833d4086aba3c0fca480549309af54bfdd8e2e URL: https://github.com/llvm/llvm-project/commit/2b833d4086aba3c0fca480549309af54bfdd8e2e DIFF: https://github.com/llvm/llvm-project/commit/2b833d4086aba3c0fca480549309af54bfdd8e2e.diff LOG:

[clang] 726d7b0 - [Sema] Simplify CheckConstraintSatisfaction. NFC

2022-05-04 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-05-04T15:53:07Z New Revision: 726d7b07fcde58c61743c45723c9b614911fe084 URL: https://github.com/llvm/llvm-project/commit/726d7b07fcde58c61743c45723c9b614911fe084 DIFF: https://github.com/llvm/llvm-project/commit/726d7b07fcde58c61743c45723c9b614911fe084.diff LOG:

[clang] ad2263d - [Sema] Replace invalid FIXME about memory leak. NFC

2022-05-05 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-05-05T15:04:11Z New Revision: ad2263de9f75119626f316e253fdc1de28d5c23a URL: https://github.com/llvm/llvm-project/commit/ad2263de9f75119626f316e253fdc1de28d5c23a DIFF: https://github.com/llvm/llvm-project/commit/ad2263de9f75119626f316e253fdc1de28d5c23a.diff LOG:

[clang] e13c28e - [Driver] Remove -fno-concept-satisfaction-caching

2022-05-05 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-05-05T15:53:00Z New Revision: e13c28ec595d99e694cb7e2589e7574dcda628ef URL: https://github.com/llvm/llvm-project/commit/e13c28ec595d99e694cb7e2589e7574dcda628ef DIFF: https://github.com/llvm/llvm-project/commit/e13c28ec595d99e694cb7e2589e7574dcda628ef.diff LOG:

[clang] 1e95d1b - [clang] Fix Clang release notes

2022-05-05 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-05-05T16:11:45Z New Revision: 1e95d1bee63837cd40e6ea5ecc95eb8854ba8d21 URL: https://github.com/llvm/llvm-project/commit/1e95d1bee63837cd40e6ea5ecc95eb8854ba8d21 DIFF: https://github.com/llvm/llvm-project/commit/1e95d1bee63837cd40e6ea5ecc95eb8854ba8d21.diff LOG:

[clang] 59179d7 - [Sema] Merge C++20 concept definitions from different modules in same TU

2022-07-25 Thread Ilya Biryukov via cfe-commits
Author: Ilya Biryukov Date: 2022-07-25T14:43:38+02:00 New Revision: 59179d72b2e3d3b99ebc342374c9c797d526ac5d URL: https://github.com/llvm/llvm-project/commit/59179d72b2e3d3b99ebc342374c9c797d526ac5d DIFF: https://github.com/llvm/llvm-project/commit/59179d72b2e3d3b99ebc342374c9c797d526ac5d.diff

[clang] [clang] CTAD: Track template template type parameters that referenced in (PR #85405)

2024-03-20 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: The change seems to be correct in the way code is written. However, I wonder what's the connection between the crash and the function being changed? Is there a way to fail gracefully if there are more mistakes in this function for incorrect code (e.g. fail deduction instea

[clang] [clang] CTAD: Track template template type parameters that referenced in (PR #85405)

2024-03-20 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > This issue comes from a bug in the implementation where we missed to handle > the template template parameter. The resulting crash is a manifestation of > this problem. Sure, that's obvious. I see that we access the vector by the template parameter index and the access

[clang] [clang-format] adds a space after not inside macros (PR #78176)

2024-03-11 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: I just wanted to bring up that using `WhitespaceSensitiveMacros` here is a little tricky because the macro name one would need to put there is `V` (the name is taken directly from the code that hit this). Having a more sophisticated option to say "parameter `V` of macro `M

[clang] [clang-format] adds a space after not inside macros (PR #78176)

2024-03-11 Thread Ilya Biryukov via cfe-commits
@@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return true; } if (Left.is(TT_UnaryOperator)) { -if (Right.isNot(tok::l_paren)) { +if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) { ilya-bi

[clang] [Sema] Fix crash in __datasizeof with unknown types (PR #80300)

2024-02-01 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/80300 Fixes #80284. Calling `getASTRecordLayout` on invalid types may crash and results of `__datasizeof` on invalid types can be arbitrary, so just use whatever `sizeof` returns. >From beeedb29d4dd1213d754ccc

[clang] [clang-tools-extra] [llvm] [Sema] Fix crash in __datasizeof with unknown types (PR #80300)

2024-02-01 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/80300 >From beeedb29d4dd1213d754cccefaf52cd0658a92d3 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Thu, 1 Feb 2024 16:12:23 +0100 Subject: [PATCH] [Sema] Fix crash in __datasizeof with unknown types Fixes #

[clang] [clang-tools-extra] [llvm] [Sema] Fix crash in __datasizeof with unknown types (PR #80300)

2024-02-01 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/80300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-01-29 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/79875 Particular example that lead to this is a very long chain of `UsingShadowDecl`s that we hit in our codebase in generated code. To avoid that, check for stack exhaustion when deserializing the declaration.

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-01-29 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/79875 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-01-29 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov commented: I think the alternative we could try to chase is turning the chain of using-shadow-decls into an array somehow, so we can process it in a loop instead of recursion. I am not sure if there is an an approach that does **not** involve structural change

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-01-29 Thread Ilya Biryukov via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t + +// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/usings.cppm -o %t/usings.pcm +// RUN: %clang_cc1 -std=c++20 -fmodule-file=usings=%t/usings.pcm %t/use.cpp -verify -fsyntax-only -Wno-stac

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-01-30 Thread Ilya Biryukov via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t + +// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/usings.cppm -o %t/usings.pcm +// RUN: %clang_cc1 -std=c++20 -fmodule-file=usings=%t/usings.pcm %t/use.cpp -verify -fsyntax-only -Wno-stac

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-01-30 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > Could you show the stack (omitting/annotating the repeated part) that leads > to failure? and/or the AST shape that leads to failure? See the test I added. All you need is ~10k overloads of a method in a class and a `using Base::func` in the derived class.\ The AST repre

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-01-30 Thread Ilya Biryukov via cfe-commits
@@ -4099,7 +4099,9 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) { // calls to Decl::getASTContext() by Decl's methods will find the // TranslationUnitDecl without crashing. D->setDeclContext(Context.getTranslationUnitDecl()); - Reader.Visit(D); + + // Reading some decl

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-01-30 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > To make this testable, maybe we can refactor > `clang::runWithSufficientStackSpace` a little bit to make `DesiredStackSize` > and `isStackNearlyExhausted::SufficientStack` configurable. Maybe... As long as we only use this in tests. However, for this particular case, we

[clang] [clang] Reapply Handle templated operators with reversed arguments (PR #72213)

2024-01-12 Thread Ilya Biryukov via cfe-commits
@@ -324,6 +324,113 @@ bool x = X() == X(); // expected-warning {{ambiguous}} } } // namespace P2468R2 +namespace GH53954{ +namespace friend_template_1 { +struct P { + template + friend bool operator==(const P&, const T&) { return true; } // expected-note {{candidate}} \ +

[clang] [clang] Reapply Handle templated operators with reversed arguments (PR #72213)

2024-01-12 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/72213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Reapply Handle templated operators with reversed arguments (PR #72213)

2024-01-12 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. I only have minor requests to add a new test and update the release note a bit. Otherwise LGMT https://github.com/llvm/llvm-project/pull/72213 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [clang] Reapply Handle templated operators with reversed arguments (PR #72213)

2024-01-12 Thread Ilya Biryukov via cfe-commits
@@ -37,6 +37,27 @@ These changes are ones which we think may surprise users when upgrading to Clang |release| because of the opportunity they pose for disruption to existing code bases. +- Fix a bug in reversed argument for templated operators. + This breaks code in C++20 wh

[clang] [clang] Reapply Handle templated operators with reversed arguments (PR #72213)

2024-01-12 Thread Ilya Biryukov via cfe-commits
@@ -10088,9 +10088,13 @@ static bool allowAmbiguity(ASTContext &Context, const FunctionDecl *F1, const FunctionDecl *F2) { if (declaresSameEntity(F1, F2)) return true; - if (F1->isTemplateInstantiation() && F2->isTemplateInstantiation() && -

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-12 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/76804 >From d8598a382fb1496a96d6ff8317c06cf73606ad84 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 3 Jan 2024 11:07:17 +0100 Subject: [PATCH 1/3] [Format] Fix isStartOfName to recognize attributes This

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-12 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/76804 >From d8598a382fb1496a96d6ff8317c06cf73606ad84 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 3 Jan 2024 11:07:17 +0100 Subject: [PATCH 1/4] [Format] Fix isStartOfName to recognize attributes This

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-12 Thread Ilya Biryukov via cfe-commits
@@ -1698,8 +1698,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { /*BasedOnStyle=*/"google", }, }; - GoogleStyle.AttributeMacros.push_back("GUARDED_BY"); ilya-biryukov wrote: I think we should postpone the inclusion of

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-12 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: @owenca, @HazardyKnusperkeks could you please take another look and approve if this looks good to you? I believe all comments should be addressed at this point. https://github.com/llvm/llvm-project/pull/76804 ___ cfe-commits maili

[clang] [llvm] [clang-tools-extra] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/76804 >From d8598a382fb1496a96d6ff8317c06cf73606ad84 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 3 Jan 2024 11:07:17 +0100 Subject: [PATCH 1/4] [Format] Fix isStartOfName to recognize attributes This

[clang] [clang-tools-extra] [llvm] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/76804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)

2024-01-15 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > Can you provide more context for this? I believe this is a follow-up to #77311. https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)

2024-01-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. Approve from my side too, but please make sure to apply suggestion from @cor3ntin and clang-format before submitting. https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-01-15 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > @ilya-biryukov any chance you/your folks could test this change for > performance implications in google? It's especially helpful to CERN, but the > last iteration of this direction had some regressions that stalled out > progress on that version a few years ago, so it'd

[clang] [clang-tools-extra] [clangd] Handle an expanded token range that ends in the `eof` token in TokenBuffer::spelledForExpanded() (PR #78092)

2024-01-15 Thread Ilya Biryukov via cfe-commits
@@ -816,6 +816,18 @@ TEST_F(TokenBufferTest, SpelledByExpanded) { EXPECT_EQ(Buffer.spelledForExpanded(findExpanded("prev good")), std::nullopt); } +TEST_F(TokenBufferTest, NoCrashForEofToken) { + recordTokens(R"cpp( +int main() { + )cpp"); + // Calling spelledForExpa

[clang] [clang-tools-extra] [clangd] Handle an expanded token range that ends in the `eof` token in TokenBuffer::spelledForExpanded() (PR #78092)

2024-01-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. Thanks, LGTM! I only have a minor (and optional) suggestion. https://github.com/llvm/llvm-project/pull/78092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang-tools-extra] [clang] [clangd] Handle an expanded token range that ends in the `eof` token in TokenBuffer::spelledForExpanded() (PR #78092)

2024-01-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/78092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-15 Thread Ilya Biryukov via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [clang-format] adds a space after not inside macros (PR #78176)

2024-01-15 Thread Ilya Biryukov via cfe-commits
@@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return true; } if (Left.is(TT_UnaryOperator)) { -if (Right.isNot(tok::l_paren)) { +if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) { ilya-bi

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-16 Thread Ilya Biryukov via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-16 Thread Ilya Biryukov via cfe-commits
@@ -15845,8 +15845,10 @@ void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { RecordDecl *RD = FD->getReturnType()->getAsRecordDecl(); if (!RD || !RD->getUnderlyingDecl()->hasAttr()) return; - // Allow `get_return_object()`. - if (FD->getDeclName().isIdentifier() && +

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-16 Thread Ilya Biryukov via cfe-commits
@@ -15845,8 +15845,10 @@ void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { RecordDecl *RD = FD->getReturnType()->getAsRecordDecl(); if (!RD || !RD->getUnderlyingDecl()->hasAttr()) return; - // Allow `get_return_object()`. - if (FD->getDeclName().isIdentifier() && +

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-17 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. I'm ok with the changes, but I left a suggestion about naming the function that I think we should follow. https://github.com/llvm/llvm-project/pull/77066 ___ cfe-commits mailing list cfe-com

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-17 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/77066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   6   7   8   9   10   >