Author: Haojian Wu
Date: 2024-06-06T15:48:23+02:00
New Revision: 79393124ff74aaaf6a43f7c88e67fd76a6e44239
URL:
https://github.com/llvm/llvm-project/commit/79393124ff74aaaf6a43f7c88e67fd76a6e44239
DIFF:
https://github.com/llvm/llvm-project/commit/79393124ff74aaaf6a43f7c88e67fd76a6e44239.diff
LO
Author: Haojian Wu
Date: 2024-06-07T12:49:41+02:00
New Revision: 6fe5428ecbd18aa263417a244c0850b1271617c0
URL:
https://github.com/llvm/llvm-project/commit/6fe5428ecbd18aa263417a244c0850b1271617c0
DIFF:
https://github.com/llvm/llvm-project/commit/6fe5428ecbd18aa263417a244c0850b1271617c0.diff
LO
https://github.com/hokein approved this pull request.
https://github.com/llvm/llvm-project/pull/94937
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2220,23 +2220,103 @@ namespace {
class ExtractTypeForDeductionGuide
: public TreeTransform {
llvm::SmallVectorImpl &MaterializedTypedefs;
+ ClassTemplateDecl *NestedPattern;
+ const MultiLevelTemplateArgumentList *OuterInstantiationArgs;
public:
typedef TreeTran
@@ -16,3 +16,73 @@ using T = A::B;
using Copy = decltype(copy);
using Copy = A::B;
+
+namespace GH94614 {
+
+template struct S {};
hokein wrote:
I wonder whether it is feasible to add an ast-dump test for this issue, I find
seeing and verifying the shape of
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/94740
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein commented:
Looks roughly good to me.
https://github.com/llvm/llvm-project/pull/94740
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2220,23 +2220,103 @@ namespace {
class ExtractTypeForDeductionGuide
: public TreeTransform {
llvm::SmallVectorImpl &MaterializedTypedefs;
+ ClassTemplateDecl *NestedPattern;
+ const MultiLevelTemplateArgumentList *OuterInstantiationArgs;
public:
typedef TreeTran
@@ -2220,23 +2220,103 @@ namespace {
class ExtractTypeForDeductionGuide
: public TreeTransform {
llvm::SmallVectorImpl &MaterializedTypedefs;
+ ClassTemplateDecl *NestedPattern;
+ const MultiLevelTemplateArgumentList *OuterInstantiationArgs;
public:
typedef TreeTran
@@ -2630,7 +2711,8 @@ struct ConvertConstructorToDeductionGuideTransform {
ParmVarDecl *transformFunctionTypeParam(
ParmVarDecl *OldParam, MultiLevelTemplateArgumentList &Args,
- llvm::SmallVectorImpl &MaterializedTypedefs) {
+ llvm::SmallVectorImpl &Material
@@ -10918,22 +10944,24 @@ QualType
Sema::DeduceTemplateSpecializationFromInitializer(
if (!(RD->getDefinition() && RD->isAggregate()))
return;
QualType Ty = Context.getRecordType(RD);
- SmallVector ElementTypes;
-
- InitListChecker CheckInitList(*
@@ -305,14 +305,32 @@ namespace {
/// structured list even in 'verify only' mode, so that we can track which
/// elements need 'empty' initializtion.
class InitListChecker {
+public:
+ struct CandidateParamTypesForAggregateDeduction {
hokein wrote:
nit: inste
@@ -10918,22 +10944,24 @@ QualType
Sema::DeduceTemplateSpecializationFromInitializer(
if (!(RD->getDefinition() && RD->isAggregate()))
return;
QualType Ty = Context.getRecordType(RD);
- SmallVector ElementTypes;
-
- InitListChecker CheckInitList(*
@@ -335,3 +335,73 @@ namespace TTP {
// CHECK-NEXT: `-TemplateArgument type 'T':'type-parameter-0-0'{{$}}
// CHECK-NEXT:`-TemplateTypeParmType {{.+}} 'T' dependent depth 0
index 0{{$}}
// CHECK-NEXT: `-TemplateTypeParm {{.+}} 'T'{{$}}
+
+namespace GH64625
@@ -335,3 +335,73 @@ namespace TTP {
// CHECK-NEXT: `-TemplateArgument type 'T':'type-parameter-0-0'{{$}}
// CHECK-NEXT:`-TemplateTypeParmType {{.+}} 'T' dependent depth 0
index 0{{$}}
// CHECK-NEXT: `-TemplateTypeParm {{.+}} 'T'{{$}}
+
+namespace GH64625
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/95213
None
>From c5f5d784a8cab287d3ec826a2636874ad9498563 Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Wed, 12 Jun 2024 11:24:10 +0200
Subject: [PATCH] [clang] Don't print extra blank when dump the template name.
-
https://github.com/hokein commented:
good catch, the fix looks good to me overall, I will leave the final stamp to
@ChuanqiXu9.
(I agree that it would be nice to have a regression test if it is not too hard
to reduce from libcxx)
https://github.com/llvm/llvm-project/pull/95202
___
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/95213
>From 3c96bf1b16360f52b235d31c08644a2749e7c808 Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Wed, 12 Jun 2024 11:24:10 +0200
Subject: [PATCH] [clang] Don't print extra blank when dump the template name.
---
cl
@@ -10918,22 +10944,24 @@ QualType
Sema::DeduceTemplateSpecializationFromInitializer(
if (!(RD->getDefinition() && RD->isAggregate()))
return;
QualType Ty = Context.getRecordType(RD);
- SmallVector ElementTypes;
-
- InitListChecker CheckInitList(*
@@ -1449,7 +1449,10 @@ void InitListChecker::CheckSubElementType(const
InitializedEntity &Entity,
// dependent non-array type or an array type with a value-dependent
// bound
assert(AggrDeductionCandidateParamTypes);
- if (!isa_and_nonnull(
+ //
hokein wrote:
Thanks for the review, I'd go with the current fix.
https://github.com/llvm/llvm-project/pull/95213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/95213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -10918,22 +10944,24 @@ QualType
Sema::DeduceTemplateSpecializationFromInitializer(
if (!(RD->getDefinition() && RD->isAggregate()))
return;
QualType Ty = Context.getRecordType(RD);
- SmallVector ElementTypes;
-
- InitListChecker CheckInitList(*
https://github.com/hokein approved this pull request.
https://github.com/llvm/llvm-project/pull/95121
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein approved this pull request.
https://github.com/llvm/llvm-project/pull/95114
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/94752
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s
+
+namespace std {
+ typedef decltype(sizeof(int)) size_t;
+
+ template
+ struct initializer_list
+ {
+const E *p;
+size_t n;
+initializer_list(const E *p, size_t n) : p(p),
https://github.com/hokein commented:
The change looks good to me. Please add a note in
`llvm-project/clang/docs/ReleaseNotes.rst`.
https://github.com/llvm/llvm-project/pull/94752
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.ll
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s
hokein wrote:
nit: please format the test file.
https://github.com/llvm/llvm-project/pull/94752
___
cfe-commits mailing list
cf
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s
+
+namespace std {
+ typedef decltype(sizeof(int)) size_t;
+
+ template
+ struct initializer_list
+ {
+const E *p;
+size_t n;
+initializer_list(const E *p, size_t n) : p(p),
https://github.com/hokein approved this pull request.
thanks, looks good.
https://github.com/llvm/llvm-project/pull/94752
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/94752
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s
hokein wrote:
yeah, that's expected, we disable the clang-format for all lit test files (see
the `clang/test/.clang-format`).
https://github.com/llvm/llvm-project/pull/94
hokein wrote:
Thanks for the patch! +1 on the idea of printing deduction guides in
diagnostics. This improves the experience for both users and compiler
developers. This is https://github.com/llvm/llvm-project/issues/92393 :)
> Perhaps an approach more similar to what we display for ambiguous
@@ -12114,6 +12115,35 @@ static void NoteFunctionCandidate(Sema &S,
OverloadCandidate *Cand,
return;
}
+ // If this is an implicit deduction guide against an implicitly defined
+ // constructor, add a note for it. Neither these deduction guides nor their
+ // corresp
@@ -12114,6 +12115,35 @@ static void NoteFunctionCandidate(Sema &S,
OverloadCandidate *Cand,
return;
}
+ // If this is an implicit deduction guide against an implicitly defined
+ // constructor, add a note for it. Neither these deduction guides nor their
+ // corresp
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/93533
In the https://github.com/llvm/llvm-project/pull/90961 fix, we miss a case
where the undeduced template parameters of the underlying deduction guide are
not transformed, which leaves incorrect depth/index informa
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/86512
>From 49747cde60dc8a1f4ed4ddcee020f71c88f35287 Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Mon, 25 Mar 2024 15:10:51 +0100
Subject: [PATCH] [clang] Implement a bitwise_copyable builtin type trait.
This patch
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/86512
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/86512
>From 011d6bbb434bdb46efe92891fe356885f82c4445 Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Mon, 25 Mar 2024 15:10:51 +0100
Subject: [PATCH] ination of 2 commits.
[clang] Implement a bitwise_copyable builtin t
@@ -1120,6 +1120,14 @@ class QualType {
/// Return true if this is a trivially copyable type (C++0x [basic.types]p9)
bool isTriviallyCopyableType(const ASTContext &Context) const;
+ /// Return true if the type is safe to bitwise copy by memcpy.
+ ///
+ /// This is an ex
@@ -2749,6 +2749,17 @@ bool QualType::isTriviallyCopyableType(const ASTContext
&Context) const {
/*IsCopyConstructible=*/false);
}
+bool QualType::isBitwiseCloneableType(const ASTContext & Context) const {
+ if (const auto *RD = getCanoni
@@ -4016,6 +4016,34 @@ Note that the `size` argument must be a compile time
constant.
Note that this intrinsic cannot yet be called in a ``constexpr`` context.
+``__is_bitwise_cloneable``
+--
+
+A type trait is used to check whether a type can be safe
hokein wrote:
> Could we rewrite the description and documentation to capture what the type
> trait is doing now? We have a lot of references to the
> `is_trivially_copyable`, which is almost fully irrelevant to the current
> implementation.
Thanks, I updated the PR description and documentat
hokein wrote:
Add @eugenis as a reviewer, could you take a look on the sanitizer bit?
https://github.com/llvm/llvm-project/pull/86512
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein approved this pull request.
Thanks for the cleanup, this looks good to me.
https://github.com/llvm/llvm-project/pull/94311
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/94349
We see some tests are failing internally after
12949c952c4fbad776a860c003ccf176973278a0.
In CAS systems, we might not see the exact binary name (clang), this patch
removes the binary name in the FileCheck conten
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/94349
>From fa0880d477439e4af3f0b1b057dc1c66a2ccbc1e Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Tue, 4 Jun 2024 14:51:10 +0200
Subject: [PATCH] [Driver] Make the FileCheck less strict for some tests.
We see some t
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/94349
>From b9bd6c36196c7f1fdf6ec7a56260425e0b7255f7 Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Tue, 4 Jun 2024 14:51:10 +0200
Subject: [PATCH] [Driver] Dont use absolute paths for invoking subcommands for
driver
@@ -12,7 +12,7 @@
// RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s
//
-// CHECK-BE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple"
"mips-mti-linux"
hokein wrote:
Thanks, I wasn't aware of th
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/94349
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/86512
>From 10d4b9e505d5ad7476071153d2d13799f5b5cf1f Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Mon, 25 Mar 2024 15:10:51 +0100
Subject: [PATCH 1/2] [clang] Implement a bitwise_copyable builtin type trait.
This pa
@@ -2667,6 +2667,29 @@ bool QualType::isTriviallyCopyableType(const ASTContext
&Context) const {
/*IsCopyConstructible=*/false);
}
+bool QualType::isBitwiseCopyableType(const ASTContext & Context) const {
+ QualType CanonicalType = getCan
@@ -526,6 +526,7 @@ TYPE_TRAIT_2(__is_layout_compatible, IsLayoutCompatible,
KEYCXX)
#include "clang/Basic/TransformTypeTraits.def"
// Clang-only C++ Type Traits
+TYPE_TRAIT_1(__is_bitwise_copyable, IsBitwiseCopyable, KEYCXX)
hokein wrote:
OK, renamed to `__
@@ -5056,6 +5056,8 @@ static bool CheckUnaryTypeTraitTypeCompleteness(Sema &S,
TypeTrait UTT,
case UTT_IsStandardLayout:
case UTT_IsPOD:
case UTT_IsLiteral:
+ // Clang extension:
hokein wrote:
Removed.
https://github.com/llvm/llvm-project/pull/86512
@@ -2667,6 +2667,29 @@ bool QualType::isTriviallyCopyableType(const ASTContext
&Context) const {
/*IsCopyConstructible=*/false);
}
+bool QualType::isBitwiseCopyableType(const ASTContext & Context) const {
+ QualType CanonicalType = getCan
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
+
+// Scalar types are bitwise copyable.
+static_assert(__is_bitwise_copyable(int));
+static_assert(__is_bitwise_copyable(int*));
+// array
+static_assert(__is_bitwise_copyable(int[10]));
+
+
+struct Forward;
@@ -526,6 +526,7 @@ TYPE_TRAIT_2(__is_layout_compatible, IsLayoutCompatible,
KEYCXX)
#include "clang/Basic/TransformTypeTraits.def"
// Clang-only C++ Type Traits
+TYPE_TRAIT_1(__is_bitwise_copyable, IsBitwiseCopyable, KEYCXX)
hokein wrote:
switched to `KEYAL
@@ -917,6 +917,18 @@ class QualType {
/// Return true if this is a trivially copyable type (C++0x [basic.types]p9)
bool isTriviallyCopyableType(const ASTContext &Context) const;
+ /// Return true if this is a bitwise copyable type.
+ ///
+ /// This is an extension in cl
@@ -526,6 +526,7 @@ TYPE_TRAIT_2(__is_layout_compatible, IsLayoutCompatible,
KEYCXX)
#include "clang/Basic/TransformTypeTraits.def"
// Clang-only C++ Type Traits
+TYPE_TRAIT_1(__is_bitwise_copyable, IsBitwiseCopyable, KEYCXX)
hokein wrote:
Done, added one, p
@@ -917,6 +917,18 @@ class QualType {
/// Return true if this is a trivially copyable type (C++0x [basic.types]p9)
bool isTriviallyCopyableType(const ASTContext &Context) const;
+ /// Return true if this is a bitwise copyable type.
+ ///
+ /// This is an extension in cl
@@ -2667,6 +2667,29 @@ bool QualType::isTriviallyCopyableType(const ASTContext
&Context) const {
/*IsCopyConstructible=*/false);
}
+bool QualType::isBitwiseCopyableType(const ASTContext & Context) const {
+ QualType CanonicalType = getCan
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/86512
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/89227
We were missing to push an record to the instantiation stack in
`DeclareAggregateDeductionGuideForTypeAlias`. This patch fixes that.
>From 04c5dfa09f78fa52b31378295a8d27a20278498a Mon Sep 17 00:00:00 2001
From:
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/89227
>From 04c5dfa09f78fa52b31378295a8d27a20278498a Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Thu, 18 Apr 2024 14:50:51 +0200
Subject: [PATCH 1/2] [clang] Fix a "!CodeSynthesisContexts.empty()" assertion
failure
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/89227
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/89358
Fixes https://github.com/llvm/llvm-project/issues/85192
Fixes https://github.com/llvm/llvm-project/issues/84492
This patch implements the "IsDeducible" constraint where the template arguments
of the alias templat
hokein wrote:
Regarding the __is_deducible type trait, GCC also provides one, but it was
hidden from users and only used for internal CTAD implementation. I'm not sure
if we should follow the same strategy in clang, ideas?
https://github.com/llvm/llvm-project/pull/89358
__
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/89370
The argument types are not modeled as children of TypeTraitExpr, therefore they
are not dumped with the default implementation.
Dumping them is really useful for ad-hoc debugging, context #89358
>From e8a9fcfa4
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/89378
Fixes https://github.com/llvm/llvm-project/issues/89013
When building the deduction guide, we use the TemplateArgsForBuildingFPrime to
transform the require-clause from the underlying class deduction guide.
Howe
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/89378
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hokein wrote:
> This seems to have broken the bot: #89476 (you should have had an email?)
>
> I reverted in #89476
sorry, and thanks for the revert. I will take a further look.
https://github.com/llvm/llvm-project/pull/89378
___
cfe-commits mailing
Author: Haojian Wu
Date: 2024-04-22T10:04:55+02:00
New Revision: 57c24eb0a7482ca7f661a2a9cb45249f1553d6d2
URL:
https://github.com/llvm/llvm-project/commit/57c24eb0a7482ca7f661a2a9cb45249f1553d6d2
DIFF:
https://github.com/llvm/llvm-project/commit/57c24eb0a7482ca7f661a2a9cb45249f1553d6d2.diff
LO
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/89358
>From 9583811bfa66ff058f5e33012cd77501ce3e5e23 Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Fri, 19 Apr 2024 10:54:12 +0200
Subject: [PATCH 1/2] [clang] CTAD: implement the missing IsDeducible
constraint for a
@@ -3207,6 +3241,59 @@
Sema::DeduceTemplateArguments(VarTemplatePartialSpecializationDecl *Partial,
return ::DeduceTemplateArguments(*this, Partial, TemplateArgs, Info);
}
+TemplateDeductionResult
+Sema::DeduceTemplateArgumentsFromType(TemplateDecl *TD, QualType FromType,
+
@@ -6100,6 +6100,17 @@ static bool EvaluateBinaryTypeTrait(Sema &Self,
TypeTrait BTT, const TypeSourceI
tok::kw___is_pointer_interconvertible_base_of);
return Self.IsPointerInterconvertibleBaseOf(Lhs, Rhs);
+ }
+ case BTT_IsDeducible: {
+
hokein wrote:
> Needs a release note, and I think we actually DO have to do those diagnostics
> here.
Added a release note for the new builtin.
https://github.com/llvm/llvm-project/pull/89358
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
hokein wrote:
> It seems to me that exposing these as children is the better option here,
> right? That way it would better model a CallExpr or template type-trait, and
> would work in our StmtProfiler et-al.
Agree that exposing them as children is better. However, we encounter an
implementat
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/89370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hokein wrote:
> > > Regarding the __is_deducible type trait, GCC also provides one, but it
> > > was hidden from users and only used for internal CTAD implementation. I'm
> > > not sure if we should follow the same strategy in clang, ideas?
> >
> >
> > I have mixed feeling. What do you think
@@ -868,13 +868,7 @@ C++20 implementation status
Class template argument deduction for alias templates
https://wg21.link/p1814r0";>P1814R0
-
-
- Clang 19 (Partial)
- The associated constraints (over.match.class.deduct#3.3) for th
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/89731
Fixes https://github.com/llvm/llvm-project/issues/89723
>From 6d292f1d3bddb5a52ca63babd4bb785266277674 Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Tue, 23 Apr 2024 11:48:12 +0200
Subject: [PATCH] [clang] coro
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/89731
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/100708
None
>From 69670cf28f04d82adde27be86af6b8ce40e7a01c Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Fri, 26 Jul 2024 09:17:50 +0200
Subject: [PATCH] [clang] Enable the -Wdangling-assignment-gsl diagnostic by
de
https://github.com/hokein closed
https://github.com/llvm/llvm-project/pull/100708
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Haojian Wu
Date: 2024-07-29T09:22:03+02:00
New Revision: 5d2c324fea2d7cf86ec50e4bb6b680acf89b2ed5
URL:
https://github.com/llvm/llvm-project/commit/5d2c324fea2d7cf86ec50e4bb6b680acf89b2ed5
DIFF:
https://github.com/llvm/llvm-project/commit/5d2c324fea2d7cf86ec50e4bb6b680acf89b2ed5.diff
LO
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/99005
The current implementation for the assignment case uses a combination of the
`LK_Extended` lifetime kind and the validity of `AEntity`, which is somewhat
messy and doesn't align well with the intended mental mode
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/99005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hokein wrote:
Thanks!
https://github.com/llvm/llvm-project/pull/99005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein created
https://github.com/llvm/llvm-project/pull/99032
This is a follow-up patch to #96475 to detect dangling assignments for C++
pointer-like objects (classes annotated with the `[[gsl::Pointer]]`). Fixes
#63310.
Similar to the behavior for built-in pointer types,
hokein wrote:
Thanks for implementing it!
I haven't looked into the implementation details yet.
Before doing so, I want to ensure I understand the standard correctly (the
standard's wording is a bit hard to follow).
Per C++
[over.match.class.deduct#1.10](https://eel.is/c++draft/over.match.cl
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/99032
>From 9ac7a9543878fc93ea036cfa533c25bbbceeddf2 Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Tue, 16 Jul 2024 12:29:35 +0200
Subject: [PATCH 1/2] [clang] Extend lifetime analysis to detect dangling
assignments
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/99032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -966,7 +969,8 @@ static bool pathOnlyInitializesGslPointer(IndirectLocalPath
&Path) {
if (It.Kind == IndirectLocalPathEntry::LifetimeBoundCall)
continue;
return It.Kind == IndirectLocalPathEntry::GslPointerInit ||
- It.Kind == IndirectLocalPathEntry:
@@ -1073,14 +1078,16 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
}
case LK_Assignment: {
- if (!MTE)
+ if (!MTE || pathContainsInit(Path))
return false;
assert(shouldLifetimeExtendThroughPath(Path) ==
PathLifetimeKind
https://github.com/hokein commented:
Thanks for the review.
https://github.com/llvm/llvm-project/pull/99032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1284,16 +1294,26 @@ void checkExprLifetime(Sema &SemaRef, const
InitializedEntity &Entity,
auto LTResult = getEntityLifetime(&Entity);
LifetimeKind LK = LTResult.getInt();
const InitializedEntity *ExtendingEntity = LTResult.getPointer();
- checkExprLifetimeImpl(Sema
@@ -1284,16 +1294,26 @@ void checkExprLifetime(Sema &SemaRef, const
InitializedEntity &Entity,
auto LTResult = getEntityLifetime(&Entity);
LifetimeKind LK = LTResult.getInt();
const InitializedEntity *ExtendingEntity = LTResult.getPointer();
- checkExprLifetimeImpl(Sema
@@ -966,7 +969,8 @@ static bool pathOnlyInitializesGslPointer(IndirectLocalPath
&Path) {
if (It.Kind == IndirectLocalPathEntry::LifetimeBoundCall)
hokein wrote:
Rewrote the `if` with the `switch`.
https://github.com/llvm/llvm-project/pull/99032
__
@@ -34,6 +34,6 @@ struct basic_string {
};
} // namespace std
void test(const char* a) {
- // verify we're emitting the `-Wdangling-assignment` warning.
+ // verify we're emitting the `-Wdangling-assignment-gsl` warning.
a = std::basic_string().c_str(); // expected-warnin
2201 - 2300 of 3165 matches
Mail list logo