CPlusPlus: Add parser support for declarations of user-defined literals

... without a space before the identifier.

Change-Id: I977ffae82eb86f5ae6ea594cba17cc486e63bf6c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2024-08-06 17:06:10 +02:00
parent 5f3a343352
commit 9926de01c1
4 changed files with 22 additions and 14 deletions

View File

@@ -12,14 +12,7 @@ CPlusPlusAutotest {
name: "Data Files"
prefix: "data/"
fileTags: ["data"]
files: [
"inlineNamespace.1.cpp",
"inlineNamespace.1.errors.txt",
"staticAssert.1.cpp",
"staticAssert.1.errors.txt",
"noExcept.1.cpp",
"noExcept.1.errors.txt"
]
files: "*"
}
cpp.defines: base.concat(['SRCDIR="' + path + '"'])

View File

@@ -0,0 +1,7 @@
wchar_t operator ""_wc(const wchar_t c) { return c; }
int main()
{
const auto c = L'c'_wc;
return c;
}

View File

@@ -179,6 +179,7 @@ void tst_cxx11::parse_data()
QTest::newRow("trailingtypespec.1") << "trailingtypespec.1.cpp" << "";
QTest::newRow("lambda.2") << "lambda.2.cpp" << "";
QTest::newRow("userDefinedLiterals.1") << "userDefinedLiterals.1.cpp" << "";
QTest::newRow("userDefinedLiterals.2") << "userDefinedLiterals.2.cpp" << "";
QTest::newRow("rawstringliterals") << "rawstringliterals.cpp" << "";
}