https://github.com/cor3ntin closed
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
github-actions[bot] wrote:
@jj-marr Congratulations on having your first Pull Request (PR) merged into the
LLVM Project!
Your changes will be combined with recent changes from other authors, then
tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a
problem with a build,
jj-marr wrote:
OK, merge whenever.
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
cor3ntin wrote:
> Is it something I can actually do myself? Or can only maintainers merge?
Yes, only maintainers can do it (you can become a maintainer after you make a
few contributions)
https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access
https://github.com/llvm/llvm-project/p
jj-marr wrote:
> @jj-marr Thanks. Do you want us to merge that for you?
Is it something I can actually do myself?
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
>From 67984fbf0374fa40fd7b73431b17baddc301290f Mon Sep 17 00:00:00 2001
From: JJ Marr
Date: Sat, 8 Mar 2025 22:00:45 -0500
Subject: [PATCH] Explain which assertion failed during consteval
---
clang/docs/Releas
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-s
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
>From 64eb62576dc1ecf0e696f2448e410c2fd77575de Mon Sep 17 00:00:00 2001
From: JJ Marr
Date: Sat, 8 Mar 2025 22:00:45 -0500
Subject: [PATCH] Explain which assertion failed during consteval
---
clang/docs/Releas
cor3ntin wrote:
@jj-marr Thanks. Do you want us to merge that for you?
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-s
https://github.com/zwuis commented:
LGTM
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5975,9 +5975,22 @@ static bool CheckConstexprFunction(EvalInfo &Info,
SourceLocation CallLoc,
Definition->hasAttr(
return true;
- if (Info.getLangOpts().CPlusPlus11) {
-const FunctionDecl *DiagDecl = Definition ? Defin
https://github.com/cor3ntin approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5975,9 +5975,22 @@ static bool CheckConstexprFunction(EvalInfo &Info,
SourceLocation CallLoc,
Definition->hasAttr(
return true;
- if (Info.getLangOpts().CPlusPlus11) {
-const FunctionDecl *DiagDecl = Definition ? Defin
https://github.com/cor3ntin edited
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5975,9 +5975,22 @@ static bool CheckConstexprFunction(EvalInfo &Info,
SourceLocation CallLoc,
Definition->hasAttr(
return true;
- if (Info.getLangOpts().CPlusPlus11) {
-const FunctionDecl *DiagDecl = Definition ? Defin
@@ -5975,9 +5975,22 @@ static bool CheckConstexprFunction(EvalInfo &Info,
SourceLocation CallLoc,
Definition->hasAttr(
return true;
- if (Info.getLangOpts().CPlusPlus11) {
-const FunctionDecl *DiagDecl = Definition ? Defin
@@ -5975,9 +5975,15 @@ static bool CheckConstexprFunction(EvalInfo &Info,
SourceLocation CallLoc,
Definition->hasAttr(
return true;
- if (Info.getLangOpts().CPlusPlus11) {
-const FunctionDecl *DiagDecl = Definition ? Defin
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-s
@@ -5975,9 +5975,15 @@ static bool CheckConstexprFunction(EvalInfo &Info,
SourceLocation CallLoc,
Definition->hasAttr(
return true;
- if (Info.getLangOpts().CPlusPlus11) {
-const FunctionDecl *DiagDecl = Definition ? Defin
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jj-marr wrote:
> LGTM modulo nit.
>
> Are you happy with the current state? @cor3ntin @Sirraide
Shouldn't CI be passing? I can't figure out why there are failures.
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-comm
@@ -5975,9 +5975,15 @@ static bool CheckConstexprFunction(EvalInfo &Info,
SourceLocation CallLoc,
Definition->hasAttr(
return true;
- if (Info.getLangOpts().CPlusPlus11) {
-const FunctionDecl *DiagDecl = Definition ? Defin
@@ -5975,9 +5975,15 @@ static bool CheckConstexprFunction(EvalInfo &Info,
SourceLocation CallLoc,
Definition->hasAttr(
return true;
- if (Info.getLangOpts().CPlusPlus11) {
-const FunctionDecl *DiagDecl = Definition ? Defin
https://github.com/zwuis commented:
LGTM module nit.
Are you happy with the current state? @cor3ntin @Sirraide
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
>From 3b6d28e4f74c1fda73abe3b5972d5ac2a43576de Mon Sep 17 00:00:00 2001
From: JJ Marr
Date: Sat, 8 Mar 2025 22:00:45 -0500
Subject: [PATCH] Explain which assertion failed during consteval
---
clang/docs/Releas
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-s
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-s
https://github.com/jj-marr ready_for_review
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
>From d06c5ab5c30e535893335af798df339b0e9c6878 Mon Sep 17 00:00:00 2001
From: JJ Marr
Date: Sat, 8 Mar 2025 22:00:45 -0500
Subject: [PATCH] Explain which assertion failed during consteval
---
.../clang/Basic/D
https://github.com/jj-marr converted_to_draft
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
>From 0cba377eb8693657b7688cd1feb1cc9c5734f307 Mon Sep 17 00:00:00 2001
From: JJ Marr
Date: Sat, 8 Mar 2025 22:00:45 -0500
Subject: [PATCH] Explain which assertion failed during consteval
---
.../clang/Basic/D
jj-marr wrote:
I'm still working on this. It seems like I broke the assertion tests. I'm
unsure why, but it should be fixed if I figure out a better way of evaluating
the macro.
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing
@@ -107,6 +107,8 @@ def err_ice_too_large : Error<
"integer constant expression evaluates to value %0 that cannot be "
"represented in a %1-bit %select{signed|unsigned}2 integer type">;
def err_expr_not_string_literal : Error<"expression is not a string literal">;
+def note
@@ -8361,6 +8361,17 @@ class ExprEvaluatorBase
return false;
}
+// If an assertion fails during constant evaluation, give a specific note
explaining that
+if (FD->getName() == "__assert_fail") {
cor3ntin wrote:
Maybe we can instead check
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -std=c++23 -verify=expected,cxx20_plus %s
+
+#ifdef __ASSERT_FUNCTION
+#undef __ASSERT_FUNCTION
+#endif
+extern "C" void __assert_fail(const char*, const char*, unsigned, const char*);
+
+#define assert(cond) \
+ ((cond) ? (void)0 : __assert_f
@@ -8361,6 +8361,17 @@ class ExprEvaluatorBase
return false;
}
+// If an assertion fails during constant evaluation, give a specific note
explaining that
+if (FD->getName() == "__assert_fail") {
cor3ntin wrote:
Either way, we need a test
https://github.com/Fznamznon edited
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Fznamznon edited
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/cor3ntin edited
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8361,6 +8361,17 @@ class ExprEvaluatorBase
return false;
}
+// If an assertion fails during constant evaluation, give a specific note
explaining that
+if (FD->getName() == "__assert_fail") {
Sirraide wrote:
> Maybe we can instead chec
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -std=c++23 -verify=expected,cxx20_plus %s
+
+#ifdef __ASSERT_FUNCTION
+#undef __ASSERT_FUNCTION
+#endif
+extern "C" void __assert_fail(const char*, const char*, unsigned, const char*);
+
+#define assert(cond) \
+ ((cond) ? (void)0 : __assert_f
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zwuis commented:
Thank you for the patch! You should add a release note in
clang/docs/ReleaseNotes.rst so that users can know the improvement.
https://github.com/llvm/llvm-project/pull/130458
___
cfe-commits mailing list
cfe-commits
@@ -8361,6 +8361,17 @@ class ExprEvaluatorBase
return false;
}
+// If an assertion fails during constant evaluation, give a specific note
explaining that
+if (FD->getName() == "__assert_fail") {
zwuis wrote:
The name of corresponding func
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: JJ Marr (jj-marr)
Changes
Take this piece of code:
```cpp
#include
consteval int square(int x) {
int result = x * x;
assert(result == 42);
return result;
}
void test() {
auto val = square(2);
}
```
The assertion will fai
https://github.com/jj-marr updated
https://github.com/llvm/llvm-project/pull/130458
>From d61892d8546944000118ad0312886da75cd6509b Mon Sep 17 00:00:00 2001
From: JJ Marr
Date: Sat, 8 Mar 2025 22:00:45 -0500
Subject: [PATCH] Explain which assertion failed during consteval
---
.../clang/Basic/D
https://github.com/jj-marr created
https://github.com/llvm/llvm-project/pull/130458
Take this piece of code:
```cpp
#include
consteval int square(int x) {
int result = x * x;
assert(result == 42);
return result;
}
void test() {
auto val = square(2);
}
```
The assertion will fail, and
50 matches
Mail list logo