https://github.com/Sirraide closed
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Sirraide wrote:
Silly me forgot to *actually update the test* after enabling raw string
literals in the dependency scanner, but *now* everything should pass.
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@list
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/88265
>From 40e533e6f58acbe832b3fa4e14ca9fd600cf77cf Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Wed, 10 Apr 2024 14:36:23 +0200
Subject: [PATCH 1/8] [Clang] Allow raw string literals in C as an extension
---
clan
benlangmuir wrote:
> I assume that @benlangmuir added the scanner unit-test to demonstrate the
> current behavior instead of trying to make sure it's preserved.
Correct. They're only interesting to the scanner insofar as they're used in
`_Pragma()` as far as I know. If we can handle them, gre
Sirraide wrote:
Alright, I just enabled raw string literals in the dependency scanner by
default; barring any further complications, I’ll merge this once CI is done.
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-comm
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/88265
>From 40e533e6f58acbe832b3fa4e14ca9fd600cf77cf Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Wed, 10 Apr 2024 14:36:23 +0200
Subject: [PATCH 1/7] [Clang] Allow raw string literals in C as an extension
---
clan
jansvoboda11 wrote:
> To clarify, that means setting the `RawStringLiterals` LangOpt in
> `DependencyDirectivesScanner.cpp`, right? I’m assuming yes, but I just want
> to make sure.
Yes, that's what I had in mind 👍
https://github.com/llvm/llvm-project/pull/88265
_
Sirraide wrote:
> I think making it so that the test passes (actually handles raw string
> literals) and updating the FIXME in DependencyDirectivesScanner.cpp should be
> fine
To clarify, that means setting the `RawStringLiterals` LangOpt in
`DependencyDirectivesScanner.cpp`, right? I’m assum
jansvoboda11 wrote:
I assume that @benlangmuir added the scanner unit-test to demonstrate the
current behavior instead of trying to make sure it's preserved. I think making
it so that the test passes (actually handles raw string literals) and updating
the FIXME in `DependencyDirectivesScanner.
Sirraide wrote:
> Clang changes LGTM modulo the dependency scanner bits.
Alright, I’ll wait for a reply from @jansvoboda11 then
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.
https://github.com/AaronBallman approved this pull request.
Clang changes LGTM modulo the dependency scanner bits.
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
AaronBallman wrote:
> > Why gnu99 mode and not gnu89 mode? I see GCC has that behavior, but I'm not
> > certain why.
>
> We went over this a while back: [#88265
> (comment)](https://github.com/llvm/llvm-project/pull/88265#discussion_r1571088366)
THAT is why this was so familiar to me! :-D Tha
Sirraide wrote:
> Why gnu99 mode and not gnu89 mode? I see GCC has that behavior, but I'm not
> certain why.
We went over this a while back:
https://github.com/llvm/llvm-project/pull/88265#discussion_r1571088366
> I'm not certain there's any harm in always supporting raw string literals
> fr
AaronBallman wrote:
> raw string literals are enabled in C++11 and later, as well as in C in gnu99
> mode and later;
Why gnu99 mode and not gnu89 mode? I see GCC has that behavior, but I'm not
certain why.
> I’m not entirely sure how to fix this candidly. It doesn’t look like
> unconditional
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/88265
>From 40e533e6f58acbe832b3fa4e14ca9fd600cf77cf Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Wed, 10 Apr 2024 14:36:23 +0200
Subject: [PATCH 1/6] [Clang] Allow raw string literals in C as an extension
---
clan
Sirraide wrote:
So, apparently, this test here
https://github.com/llvm/llvm-project/blob/cb76896d6e45e2c9b7ef5e47b6ec37aeca43f7a8/clang/unittests/Lex/DependencyDirectivesScannerTest.cpp#L586-L589
is now failing, presumably because of this:
https://github.com/llvm/llvm-project/blob/cb76896d6e45
Sirraide wrote:
Alright, I think this has the behaviour that we want now:
- raw string literals are enabled in C++11 and later, as well as in C in gnuXY
mode;
- raw string literals can be explicitly enabled or disabled in C (and in C++
standards before C++11) using `-f[no-]raw-string-literals`;
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/88265
>From 40e533e6f58acbe832b3fa4e14ca9fd600cf77cf Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Wed, 10 Apr 2024 14:36:23 +0200
Subject: [PATCH 1/5] [Clang] Allow raw string literals in C as an extension
---
clan
cor3ntin wrote:
> C has Unicode string literals as well: https://godbolt.org/z/chdjYrK9v and so
> if we're allowing raw string literals, it makes sense to also allow raw
> unicode string literals IMO. I don't think we need to rename the flag though.
Yes, these things are completely orthogonal,
https://github.com/Sirraide edited
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
// the sequence "<::" will be unconditionally treated as "[:".
// Cf. Lexer::LexTokenInternal.
LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11;
+ LangOpts.RawStringLiterals = Lexi
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
// the sequence "<::" will be unconditionally treated as "[:".
// Cf. Lexer::LexTokenInternal.
LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11;
+ LangOpts.RawStringLiterals = Lexi
AaronBallman wrote:
> In that case I think it might just make sense to ignore the flag in C++11 and
> later then and allow it before C++11.
I think that makes the most sense.
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing lis
AaronBallman wrote:
C has Unicode string literals as well: https://godbolt.org/z/chdjYrK9v and so
if we're allowing raw string literals, it makes sense to also allow raw unicode
string literals IMO. I don't think we need to rename the flag though.
https://github.com/llvm/llvm-project/pull/8826
Sirraide wrote:
@AaronBallman I just noticed something that I’ve somehow not realised until now
even though I’d already written a test case for it: Not only does GCC allow raw
string literals in gnuXY mode, but also UTF string literals, e.g. `u"foo"`
(https://godbolt.org/z/771s8ne5d).
Should
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
// the sequence "<::" will be unconditionally treated as "[:".
// Cf. Lexer::LexTokenInternal.
LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11;
+ LangOpts.RawStringLiterals = Lexi
Sirraide wrote:
> I think we should allow users to enable them in C++03 modes if
> -fraw-string-literals is passed. I think it's fine to have
> -fno-raw-string-literals that allows users to disable them in C++03 mode (in
> case an earlier command line option opted into them and the user wants
AaronBallman wrote:
Btw, it seems that precommit CI found some valid issues to be addressed
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm
AaronBallman wrote:
> > I don't think we should allow it for C++11 and later modes
>
> To clarify, should we allow enabling them in e.g. `c++03` mode if
> `-fraw-string-literals` is passed? I don’t see why not, but I’m not entirely
> sure whether you’re saying we should not support that flag i
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
// the sequence "<::" will be unconditionally treated as "[:".
// Cf. Lexer::LexTokenInternal.
LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11;
+ LangOpts.RawStringLiterals = Lexi
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
// the sequence "<::" will be unconditionally treated as "[:".
// Cf. Lexer::LexTokenInternal.
LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11;
+ LangOpts.RawStringLiterals = Lexi
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
// the sequence "<::" will be unconditionally treated as "[:".
// Cf. Lexer::LexTokenInternal.
LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11;
+ LangOpts.RawStringLiterals = Lexi
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
// the sequence "<::" will be unconditionally treated as "[:".
// Cf. Lexer::LexTokenInternal.
LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11;
+ LangOpts.RawStringLiterals = Lexi
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/88265
>From 40e533e6f58acbe832b3fa4e14ca9fd600cf77cf Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Wed, 10 Apr 2024 14:36:23 +0200
Subject: [PATCH 1/2] [Clang] Allow raw string literals in C as an extension
---
clan
Sirraide wrote:
> I don't think we should allow it for C++11 and later modes
To clarify, should we allow enabling them in e.g. `c++03` mode if
`-fraw-string-literals` is passed? I don’t see why not, but I’m not entirely
sure whether you’re saying we should not support that flag in C++ (neither
@@ -130,6 +130,12 @@ struct LangStandard {
/// hasDigraphs - Language supports digraphs.
bool hasDigraphs() const { return Flags & Digraphs; }
+ /// hasRawStringLiterals - Language supports R"()" raw string literals.
+ bool hasRawStringLiterals() const {
+// GCC supp
@@ -130,6 +130,12 @@ struct LangStandard {
/// hasDigraphs - Language supports digraphs.
bool hasDigraphs() const { return Flags & Digraphs; }
+ /// hasRawStringLiterals - Language supports R"()" raw string literals.
+ bool hasRawStringLiterals() const {
+// GCC supp
@@ -130,6 +130,12 @@ struct LangStandard {
/// hasDigraphs - Language supports digraphs.
bool hasDigraphs() const { return Flags & Digraphs; }
+ /// hasRawStringLiterals - Language supports R"()" raw string literals.
+ bool hasRawStringLiterals() const {
+// GCC supp
@@ -130,6 +130,12 @@ struct LangStandard {
/// hasDigraphs - Language supports digraphs.
bool hasDigraphs() const { return Flags & Digraphs; }
+ /// hasRawStringLiterals - Language supports R"()" raw string literals.
+ bool hasRawStringLiterals() const {
+// GCC supp
@@ -130,6 +130,12 @@ struct LangStandard {
/// hasDigraphs - Language supports digraphs.
bool hasDigraphs() const { return Flags & Digraphs; }
+ /// hasRawStringLiterals - Language supports R"()" raw string literals.
+ bool hasRawStringLiterals() const {
+// GCC supp
@@ -43,6 +43,9 @@ code bases.
C/C++ Language Potentially Breaking Changes
---
+- Clang now supports raw string literals in ``-std=gnuXY`` mode as an
extension in
+ C. This behaviour can also be overridden using
``-f[no-]raw-string-lit
https://github.com/AaronBallman edited
https://github.com/llvm/llvm-project/pull/88265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/AaronBallman commented:
Thank you for working on this! Broadly speaking, I think the idea makes a lot
of sense.
> GCC does not seem to support raw string literals in C++ before C++11, even
> if e.g. -std=gnu++03 is passed. Should we follow this behaviour or should we
> ena
llvmbot wrote:
@llvm/pr-subscribers-clang-driver
Author: None (Sirraide)
Changes
This is a tentative implementation of support for raw string literals in C
following the discussion on #85703.
GCC supports raw string literals in C in `-gnuXY` mode. This pr both enables
raw string litera
https://github.com/Sirraide created
https://github.com/llvm/llvm-project/pull/88265
This is a tentative implementation of support for raw string literals in C
following the discussion on #85703.
GCC supports raw string literals in C in `-gnuXY` mode. This pr both enables
raw string literals
47 matches
Mail list logo