================ @@ -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 supports raw string literals in C, but not in C++ before C++11. + return isCPlusPlus11() || (!isCPlusPlus() && isGNUMode()); ---------------- AaronBallman wrote:
GCC doesn't allow them in gnu89 mode: https://godbolt.org/z/hahja6Y87 If I had to hazard a guess as to why, my guess is that there are concerns about `R` conflicting with a user-defined macro. The same concern exists in all versions of C, but code explicitly compiling in C89 mode can be a signal the code isn't being actively maintained in some regard. But still, this is a bit of a surprise, so it might be nice to understand better why the discrepancy exists. 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