cor3ntin wrote:
It would be better to do, in all cases
```cpp
Diag(PrefixEnd, diag::err_invalid_char_raw_delim) <<
escapeCStyle(*PrefixEnd);
```
(and remove the `err_invalid_newline_raw_delim` diagnostic altogether)
https://github.com/llvm/llvm-project/pull/81670
ldrumm wrote:
Should we be looking for `\r` as well?
If the testcase is checked out with DOS line endings (e.g. on a windows
machine), then the test clang/test/Lexer/raw-string-dlim-invalid.cpp fails
I don't know what the C++ spec says, but I think this diagnostic should work
for both common
github-actions[bot] wrote:
@akshaykumars614 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
https://github.com/akshaykumars614 closed
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/akshaykumars614 updated
https://github.com/llvm/llvm-project/pull/81670
>From c2f716ee5f787ec3df63511fd5f565a3deee4d6e Mon Sep 17 00:00:00 2001
From: akshaykumars614
Date: Tue, 13 Feb 2024 16:29:51 -0500
Subject: [PATCH 1/7] issue: #18079 (bad errwqor message on incorrect
https://github.com/akshaykumars614 reopened
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
akshaykumars614 wrote:
Thank you for reviewing:)
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/akshaykumars614 closed
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jroelofs approved this pull request.
LGTM. Let me know if you need me to press the "merge" button for you.
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -E -fsyntax-only -verify %s
+
+// expected-error@+2{{invalid character ')' character in raw string delimiter;
use PREFIX( )PREFIX to delimit raw string}}
akshaykumars614 wrote:
got it! Updated.
https://github.com/akshaykumars614 updated
https://github.com/llvm/llvm-project/pull/81670
>From c2f716ee5f787ec3df63511fd5f565a3deee4d6e Mon Sep 17 00:00:00 2001
From: akshaykumars614
Date: Tue, 13 Feb 2024 16:29:51 -0500
Subject: [PATCH 1/7] issue: #18079 (bad errwqor message on incorrect
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -E -fsyntax-only -verify %s
+
+// expected-error@+2{{invalid character ')' character in raw string delimiter;
use PREFIX( )PREFIX to delimit raw string}}
jroelofs wrote:
Before this change, the message used to say `character
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -E -fsyntax-only -verify %s
+
+// expected-error@+2{{invalid character ')' character in raw string delimiter;
use PREFIX( )PREFIX to delimit raw string}}
akshaykumars614 wrote:
I did not understand what you mean by old
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -E -fsyntax-only -verify %s
+
+// expected-error@+2{{invalid character ')' character in raw string delimiter;
use PREFIX( )PREFIX to delimit raw string}}
jroelofs wrote:
This has the old spelling of that diagnostic.
Also,
https://github.com/akshaykumars614 updated
https://github.com/llvm/llvm-project/pull/81670
>From c2f716ee5f787ec3df63511fd5f565a3deee4d6e Mon Sep 17 00:00:00 2001
From: akshaykumars614
Date: Tue, 13 Feb 2024 16:29:51 -0500
Subject: [PATCH 1/6] issue: #18079 (bad errwqor message on incorrect
@@ -2270,9 +2270,11 @@ bool Lexer::LexRawStringLiteral(Token , const
char *CurPtr,
const char *PrefixEnd = [PrefixLen];
if (PrefixLen == 16) {
Diag(PrefixEnd, diag::err_raw_delim_too_long);
- } else {
+ } else if (*PrefixEnd != '\n') {
@@ -2270,9 +2270,11 @@ bool Lexer::LexRawStringLiteral(Token , const
char *CurPtr,
const char *PrefixEnd = [PrefixLen];
if (PrefixLen == 16) {
Diag(PrefixEnd, diag::err_raw_delim_too_long);
- } else {
+ } else if (*PrefixEnd != '\n') {
https://github.com/akshaykumars614 edited
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2270,9 +2270,11 @@ bool Lexer::LexRawStringLiteral(Token , const
char *CurPtr,
const char *PrefixEnd = [PrefixLen];
if (PrefixLen == 16) {
Diag(PrefixEnd, diag::err_raw_delim_too_long);
- } else {
+ } else if (*PrefixEnd != '\n') {
@@ -2270,9 +2270,11 @@ bool Lexer::LexRawStringLiteral(Token , const
char *CurPtr,
const char *PrefixEnd = [PrefixLen];
if (PrefixLen == 16) {
Diag(PrefixEnd, diag::err_raw_delim_too_long);
- } else {
+ } else if (*PrefixEnd != '\n') {
https://github.com/akshaykumars614 updated
https://github.com/llvm/llvm-project/pull/81670
>From c2f716ee5f787ec3df63511fd5f565a3deee4d6e Mon Sep 17 00:00:00 2001
From: akshaykumars614
Date: Tue, 13 Feb 2024 16:29:51 -0500
Subject: [PATCH 1/5] issue: #18079 (bad errwqor message on incorrect
@@ -2270,9 +2270,11 @@ bool Lexer::LexRawStringLiteral(Token , const
char *CurPtr,
const char *PrefixEnd = [PrefixLen];
if (PrefixLen == 16) {
Diag(PrefixEnd, diag::err_raw_delim_too_long);
- } else {
+ } else if (*PrefixEnd != '\n') {
@@ -100,7 +100,10 @@ def err_raw_delim_too_long : Error<
"raw string delimiter longer than 16 characters"
"; use PREFIX( )PREFIX to delimit raw string">;
def err_invalid_char_raw_delim : Error<
- "invalid character '%0' character in raw string delimiter"
+ "invalid
@@ -2270,9 +2270,11 @@ bool Lexer::LexRawStringLiteral(Token , const
char *CurPtr,
const char *PrefixEnd = [PrefixLen];
if (PrefixLen == 16) {
Diag(PrefixEnd, diag::err_raw_delim_too_long);
- } else {
+ } else if (*PrefixEnd != '\n') {
@@ -0,0 +1,5 @@
+// RUN: not %clang_cc1 -E %s 2>&1 | grep 'error: invalid newline character in
raw string delimiter; use PREFIX( )PREFIX to delimit raw string'
jroelofs wrote:
mind also adding a test for the `err_invalid_char_raw_delim` case while you're
https://github.com/akshaykumars614 updated
https://github.com/llvm/llvm-project/pull/81670
>From c2f716ee5f787ec3df63511fd5f565a3deee4d6e Mon Sep 17 00:00:00 2001
From: akshaykumars614
Date: Tue, 13 Feb 2024 16:29:51 -0500
Subject: [PATCH 1/4] issue: #18079 (bad errwqor message on incorrect
https://github.com/akshaykumars614 updated
https://github.com/llvm/llvm-project/pull/81670
>From c2f716ee5f787ec3df63511fd5f565a3deee4d6e Mon Sep 17 00:00:00 2001
From: akshaykumars614
Date: Tue, 13 Feb 2024 16:29:51 -0500
Subject: [PATCH 1/3] issue: #18079 (bad errwqor message on incorrect
@@ -0,0 +1,5 @@
+// RUN: not %clang_cc1 -E %s 2>&1 | grep 'error: invalid newline character in
raw string delimiter; use PREFIX( )PREFIX to delimit raw string'
akshaykumars614 wrote:
Great! I will change that.
https://github.com/llvm/llvm-project/pull/81670
@@ -2270,10 +2270,12 @@ bool Lexer::LexRawStringLiteral(Token , const
char *CurPtr,
const char *PrefixEnd = [PrefixLen];
if (PrefixLen == 16) {
Diag(PrefixEnd, diag::err_raw_delim_too_long);
- } else {
+ } else if (*PrefixEnd != '\n') {
@@ -0,0 +1,5 @@
+// RUN: not %clang_cc1 -E %s 2>&1 | grep 'error: invalid newline character in
raw string delimiter; use PREFIX( )PREFIX to delimit raw string'
jroelofs wrote:
Please use `-fsyntax-only -verify` instead of `grep` for checking diagnostics.
@@ -102,6 +102,9 @@ def err_raw_delim_too_long : Error<
def err_invalid_char_raw_delim : Error<
"invalid newline character in raw string delimiter"
"; use PREFIX( )PREFIX to delimit raw string">;
+def err_invalid_nexline_raw_delim : Error<
jroelofs wrote:
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 4e005515ec5ecedf2cd986097e45cab59f9914da
ac8b99309b07b6c7114dfbf784a46d2fb5d9dcc4 --
https://github.com/akshaykumars614 updated
https://github.com/llvm/llvm-project/pull/81670
>From c2f716ee5f787ec3df63511fd5f565a3deee4d6e Mon Sep 17 00:00:00 2001
From: akshaykumars614
Date: Tue, 13 Feb 2024 16:29:51 -0500
Subject: [PATCH 1/2] issue: #18079 (bad errwqor message on incorrect
jroelofs wrote:
Feel free to keep it open and push more commits to the branch.
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
akshaykumars614 wrote:
Got it. I will look upon it further. Now should I close this pull request or
add the updated commit here itself?
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
jroelofs wrote:
> I am new to this project. Please let me know if any files need to be added.
>
> I don't believe any testing or test suite changes are required for this
> change.
This particular change will break this usage of that diagnostic, which expects
that format argument:
https://github.com/tbaederr edited
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
akshaykumars614 wrote:
I am new to this project. Please let me know if any files need to be added.
I don't believe any testing or test suite changes are required for this change.
https://github.com/llvm/llvm-project/pull/81670
___
cfe-commits mailing
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (akshaykumars614)
Changes
(bad error message on incorrect string literal)
Fixed the error message for incorrect string literal
before:
test.cpp:1:19: error: invalid character '
' character in raw string delimiter; use PREFIX(
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,
https://github.com/akshaykumars614 created
https://github.com/llvm/llvm-project/pull/81670
(bad error message on incorrect string literal)
Fixed the error message for incorrect string literal
before:
test.cpp:1:19: error: invalid character '
' character in raw string delimiter; use PREFIX(
41 matches
Mail list logo