Open
Description
When a function type macro is defined with the pasting operator applied to string token the macro parser warns this is an invalid use of macro pasting.
An example of a valid macro rejected by Eclipse CDT 4.29.0 but accepted by compilers:
#include <string_view>
#include <iostream>
using namespace std::literals;
/* define a static C++ stringview by calling the sv operator */
#define STRVIEW(name, str) static constexpr std::string_view name = str ## sv
STRVIEW(k_foo, "stringview!");
int main()
{
std::cout << "stringview is " << k_foo << std::endl;
return 0;
}
Expected: should allow the string token to be concatenated with the literal sv to produce the operator call "stringview"sv.
Actual behaviour: rejects the concatenation as invalid.
Observed on Eclipse 2023.09 (4.29.0) on Ubuntu Linux with OpenJDK.