forked from qt-creator/qt-creator
Only string literals were considered so far. Properly consider character literals as well. Fixes: QTCREATORBUG-31342 Change-Id: I880546c1384f48ba9f81a6c6716e50fb7781cc11 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
74 lines
976 B
C++
74 lines
976 B
C++
auto func()
|
|
{
|
|
return R"(foo
|
|
|
|
R"notaprefix!(
|
|
barfoobar)" R"(second)" /* comment */ R"(third)";
|
|
}
|
|
|
|
void keywords()
|
|
{
|
|
bool b1 = true;
|
|
bool b2 = false;
|
|
void *p = nullptr;
|
|
}
|
|
|
|
void numberLiterals()
|
|
{
|
|
auto integer = 1;
|
|
auto numFloat1 = 1.2f;
|
|
auto numFloat2 = 1.2;
|
|
}
|
|
|
|
template<int n = 5> class C;
|
|
|
|
struct ConversionFunction {
|
|
operator int();
|
|
};
|
|
|
|
template<typename T> concept NoConstraint = true;
|
|
|
|
const char16_t *operator ""_w(const char16_t *s, size_t) { return s; }
|
|
const auto s = u"one"_w;
|
|
const auto s2 = L"hello";
|
|
const auto s3 = u8"hello";
|
|
const auto s4 = U"hello";
|
|
const auto s5 = uR"("o
|
|
ne")"_w;
|
|
const auto s6 = u"o\
|
|
ne"_w;
|
|
|
|
static void parenTest()
|
|
{
|
|
do {
|
|
/* comment */ \
|
|
} while (false);
|
|
}
|
|
|
|
const char* s7 = R"(
|
|
))";
|
|
|
|
// comment
|
|
{
|
|
|
|
}
|
|
|
|
/*
|
|
*
|
|
*/
|
|
{
|
|
|
|
}
|
|
|
|
static void parenTest2()
|
|
{
|
|
|
|
parenTest();
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
wchar_t operator ""_wc(const wchar_t c) { return c; }
|
|
const auto c = L'c'_wc;
|