It is valid in C and C++ to break a string literal because the preprocessor or the compiler will concatenate adjacent string literals.
const char *zStr = "a" "b"; // valid
What happens when string literals are prefixed with L
(wide characters), u
(UTF-16), U
(UTF-32), u8
(UTF-8), and raw string literals (R"foo(this is a "raw string literal" with double quotes)foo"
)?
For example, is the following allowed:
const wchar_t *zStr = L"a" "b"; // valid?
In C++0x your example is valid according to [lex.string]/p13:
In C++03 this same section said that this code had undefined behavior:
Yes, that particular example is allowed by C++0x. Any combination of prefixless and L-prefixed literals will be treated as though all are L-prefixed.
EDIT: Citation -- N3242 (current C++0x working draft) §2.14.5/13: