yronglin wrote:
> > @erichkeane Can you please take a look?
>
> Looking now, I was out on Friday due to illness.
I'm sorry to hear that. Sending all my best and wishing you a rapid comeback.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-com
erichkeane wrote:
> @erichkeane Can you please take a look?
Looking now, I was out on Friday due to illness.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
yronglin wrote:
Thanks for the new test case, it's fixed with
https://github.com/llvm/llvm-project/pull/92527
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
jyknight wrote:
We _don't_ diagnose it at the end of the definition of M -- it looks like we
explicitly intentionally stopped doing so in the commit I referenced. That's
why I'm a little confused here.
With this patch, we start to diagnose only in the final line of code, `void
test(M m = {})
Endilll wrote:
> It might violate https://eel.is/c++draft/temp.inst#11 to attempt to
> instantiate the unused S::operator int?
I don't think this clause of the standard is violated: you need to instantiate
a declaration of the conversion function to at the end of definition of `M`,
otherwise
jyknight wrote:
Here's a test case that clang diagnoses with `-Wundefined-inline` after this
patch, which I'm not sure whether is correct or not. It might violate
https://eel.is/c++draft/temp.inst#11 to attempt to instantiate the unused
`S::operator int`?
I'm having a hard time telling whethe
yronglin wrote:
@erichkeane Can you please take a look?
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yronglin wrote:
Sorry for the late reply, I found the update of comments from the email, and I
have a new PR that fixes these problems.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
erichkeane wrote:
I think we have enough evidence that we have to revert this, so I've done so in
224116ab9f4d97acb0cca76dc63c1d3d4a253078
@yronglin : Please submit a PR that includes the original patch + whatever it
takes to fix the above issues. Unfortunately reverts happen :/ But I
defin
ZequanWu wrote:
Here's a smaller repro of the `-Wuninitialized` warning:
```
int TestBody_got;
namespace std {
template struct integral_constant {
static const int value = __v;
};
template using enable_if_t = _Tp;
template class initializer_list {};
template
constexpr bool IsTypeOrDerived =
ZequanWu wrote:
Can we revert this change while you are investigating if this fix is not
trivial?
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/c
yronglin wrote:
I've debug in local. The crash issue caused by initializer rebuild failed in
https://github.com/llvm/llvm-project/blob/8e00703be9ceb41d9b80c2bc8f024a9610b9aaa1/clang/lib/Sema/SemaExpr.cpp#L5717-L5721
, if remove Line 5717 `SFINAETrap Trap(*this);`, we can got diagnostics like
t
ZequanWu wrote:
Great, I just finished a creduce run with renaming pass disabled, but yours is
short.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listin
yronglin wrote:
I've a more short reproducer:
```C++
namespace std {
template class initializer_list {};
}
template class C {
public:
C(std::initializer_list);
};
template using Ptr =__remove_pointer(T) *;
template C(T) -> C, sizeof(T)>;
class A {
public:
template
T1 *some_func(T2
yronglin wrote:
Thanks, I'll take a look now.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Endilll wrote:
@ZequanWu thank you for your help, but next time you should disable renaming
passes as specified in
https://github.com/llvm/llvm-project/pull/89807#issuecomment-2102760018.
C-Reduce output can be typically reduced further manually, but it's a pain
without names.
https://github
ZequanWu wrote:
```
$ cat a.cpp
namespace std {
template struct b {
static const int c = a;
};
template using e = d;
template struct p {
using g = f;
};
template using i = p::g;
template class initializer_list {};
template using j = __remove_pointer(d);
template using k = j;
template
yronglin wrote:
> Heads up. This causes clang to crash on some code. I'm running creduce to
> reduce the cpp source file.
>
> ```
> clang:
> /usr/local/google/home/zequanwu/workspace/llvm/clang/lib/Sema/SemaDecl.cpp:16509:
> Decl *clang::Sema::ActOnFinishFunctionBody(Decl *, Stmt *, bool): As
ZequanWu wrote:
Heads up. This causes clang to crash on some code. I'm running creduce to
reduce the cpp source file.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
https://github.com/yronglin closed
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yronglin wrote:
> > I'd like to proposal a separate PR for static analyzer. #91879 WDYT?
>
> That sounds good to me.
Thanks for your confirmation! If you don’t have any concerns, I'd like to land
this PR. 🤩
https://github.com/llvm/llvm-project/pull/87933
__
zygoloid wrote:
> I'd like to proposal a separate PR for static analyzer. #91879 WDYT?
That sounds good to me.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailm
yronglin wrote:
@zygoloid IIUC, since `CXXDefaultArgExpr` and `CXXDefaultInitExpr` were not
added to CFG before and were fall back to constant evaluation in ExprEngine,
they were not processed correctly in StaticAnalyzer.
In CFG:
https://github.com/llvm/llvm-project/blob/63224d717108d927e998d
https://github.com/yronglin updated
https://github.com/llvm/llvm-project/pull/87933
>From 9fba6da7cb1ffbc7d46b69c6ac0cfd15a89c4b56 Mon Sep 17 00:00:00 2001
From: yronglin
Date: Mon, 8 Apr 2024 01:38:23 +0800
Subject: [PATCH 1/6] [Clang] Support lifetime extension of temporary created
by aggreg
https://github.com/yronglin updated
https://github.com/llvm/llvm-project/pull/87933
>From 9fba6da7cb1ffbc7d46b69c6ac0cfd15a89c4b56 Mon Sep 17 00:00:00 2001
From: yronglin
Date: Mon, 8 Apr 2024 01:38:23 +0800
Subject: [PATCH 1/5] [Clang] Support lifetime extension of temporary created
by aggreg
yronglin wrote:
Many thanks for your review and help! I‘d like to take a few days to try to
update static analyzer.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/
https://github.com/zygoloid approved this pull request.
Looks great!
I think it'd be good to understand what's happening with the static analyzer
test, and update the comment to explain. But given that this is fixing a
conformance / wrong code bug, I don't think we should block this PR on fixi
@@ -711,6 +711,26 @@ void InitListChecker::FillInEmptyInitForField(unsigned
Init, FieldDecl *Field,
if (VerifyOnly)
return;
+ // Enter a lifetime extension context, then we can support lifetime
+ // extension of temporary created by aggregate initializ
https://github.com/yronglin deleted
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -122,7 +122,7 @@ void aggregateWithReferences() {
clang_analyzer_dump(viaReference.ry); // expected-warning-re
{{&lifetime_extended_object{Composite, viaReference, S{{[0-9]+}}} }}
// clang does not currently implement extending lifetime of object bound to
reference me
https://github.com/yronglin updated
https://github.com/llvm/llvm-project/pull/87933
>From 9fba6da7cb1ffbc7d46b69c6ac0cfd15a89c4b56 Mon Sep 17 00:00:00 2001
From: yronglin
Date: Mon, 8 Apr 2024 01:38:23 +0800
Subject: [PATCH 1/4] [Clang] Support lifetime extension of temporary created
by aggreg
https://github.com/yronglin edited
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yronglin wrote:
Thanks for you review!
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -122,7 +122,7 @@ void aggregateWithReferences() {
clang_analyzer_dump(viaReference.ry); // expected-warning-re
{{&lifetime_extended_object{Composite, viaReference, S{{[0-9]+}}} }}
// clang does not currently implement extending lifetime of object bound to
reference me
@@ -711,6 +711,26 @@ void InitListChecker::FillInEmptyInitForField(unsigned
Init, FieldDecl *Field,
if (VerifyOnly)
return;
+ // Enter a lifetime extension context, then we can support lifetime
+ // extension of temporary created by aggregate initializ
https://github.com/yronglin deleted
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8194,25 +8216,18 @@ void Sema::checkInitializerLifetime(const
InitializedEntity &Entity,
}
switch (shouldLifetimeExtendThroughPath(Path)) {
+ case PathLifetimeKind::ShouldExtend:
yronglin wrote:
Hmm, thanks point it out, somehow I misund
@@ -10698,7 +10698,7 @@ C++ defect report implementation
status
https://cplusplus.github.io/CWG/issues/1815.html";>1815
CD4
Lifetime extension in aggregate initialization
-No
+Clang 19
yronglin wrote:
Thanks for your tips!
https://github.
@@ -269,6 +269,26 @@ void init_capture_init_list() {
// CHECK: }
}
+void check_dr1815() { // dr1815: yes
+#if __cplusplus >= 201402L
+
+ struct A {
+int &&r = 0;
+~A() {}
+ };
+
+ struct B {
+A &&a = A{};
+~B() {}
+ };
+
+ // CHECK: void @_Z12check_dr181
@@ -206,13 +206,10 @@ namespace cwg1814 { // cwg1814: yes
#endif
}
-namespace cwg1815 { // cwg1815: no
+namespace cwg1815 { // cwg1815: yes
yronglin wrote:
Agree 100%!
https://github.com/llvm/llvm-project/pull/87933
__
@@ -8194,25 +8216,18 @@ void Sema::checkInitializerLifetime(const
InitializedEntity &Entity,
}
switch (shouldLifetimeExtendThroughPath(Path)) {
+ case PathLifetimeKind::ShouldExtend:
yronglin wrote:
Yeah, `ShouldExtend ` can be removed, and
@@ -711,6 +711,26 @@ void InitListChecker::FillInEmptyInitForField(unsigned
Init, FieldDecl *Field,
if (VerifyOnly)
return;
+ // Enter a lifetime extension context, then we can support lifetime
+ // extension of temporary created by aggregate initializ
@@ -206,13 +206,10 @@ namespace cwg1814 { // cwg1814: yes
#endif
}
-namespace cwg1815 { // cwg1815: no
+namespace cwg1815 { // cwg1815: yes
zygoloid wrote:
A test for constant evaluation would be nice here too. Maybe:
```c++
struct C { const int &r = 0; };
co
@@ -10698,7 +10698,7 @@ C++ defect report implementation
status
https://cplusplus.github.io/CWG/issues/1815.html";>1815
CD4
Lifetime extension in aggregate initialization
-No
+Clang 19
zygoloid wrote:
```suggestion
Clang 19
```
We use
@@ -122,7 +122,7 @@ void aggregateWithReferences() {
clang_analyzer_dump(viaReference.ry); // expected-warning-re
{{&lifetime_extended_object{Composite, viaReference, S{{[0-9]+}}} }}
// clang does not currently implement extending lifetime of object bound to
reference me
@@ -269,6 +269,26 @@ void init_capture_init_list() {
// CHECK: }
}
+void check_dr1815() { // dr1815: yes
+#if __cplusplus >= 201402L
+
+ struct A {
+int &&r = 0;
+~A() {}
+ };
+
+ struct B {
+A &&a = A{};
+~B() {}
+ };
+
+ // CHECK: void @_Z12check_dr181
@@ -8194,25 +8216,18 @@ void Sema::checkInitializerLifetime(const
InitializedEntity &Entity,
}
switch (shouldLifetimeExtendThroughPath(Path)) {
+ case PathLifetimeKind::ShouldExtend:
zygoloid wrote:
Do we need separate `ShouldExtend` and `Ex
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid commented:
Thanks for working on this.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yronglin wrote:
friendly ping~
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/yronglin updated
https://github.com/llvm/llvm-project/pull/87933
>From 9fba6da7cb1ffbc7d46b69c6ac0cfd15a89c4b56 Mon Sep 17 00:00:00 2001
From: yronglin
Date: Mon, 8 Apr 2024 01:38:23 +0800
Subject: [PATCH 1/3] [Clang] Support lifetime extension of temporary created
by aggreg
https://github.com/yronglin edited
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yronglin wrote:
Friendly ping! @zygoloid @hubert-reinterpretcast
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yronglin wrote:
Friendly ping~ @zygoloid @hubert-reinterpretcast
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
cor3ntin wrote:
@hubert-reinterpretcast ping!
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yronglin wrote:
friendly ping~
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/yronglin updated
https://github.com/llvm/llvm-project/pull/87933
>From 9fba6da7cb1ffbc7d46b69c6ac0cfd15a89c4b56 Mon Sep 17 00:00:00 2001
From: yronglin
Date: Mon, 8 Apr 2024 01:38:23 +0800
Subject: [PATCH 1/2] [Clang] Support lifetime extension of temporary created
by aggreg
https://github.com/yronglin updated
https://github.com/llvm/llvm-project/pull/87933
>From 9fba6da7cb1ffbc7d46b69c6ac0cfd15a89c4b56 Mon Sep 17 00:00:00 2001
From: yronglin
Date: Mon, 8 Apr 2024 01:38:23 +0800
Subject: [PATCH 1/2] [Clang] Support lifetime extension of temporary created
by aggreg
https://github.com/yronglin edited
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yronglin wrote:
friendly ping~
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/yronglin edited
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
61 matches
Mail list logo