Skip to content

The use of parenthesis gives compilation errors in some situations #3682

@Danixu

Description

@Danixu

Description

Hello,

Trying to create a json using raw data written directly into the program code, I have noticed that when you finish an string by a parenthesis ")", the program won't compiles.

This example won't compiles:
json test = R"({ "a": "b)"})"_json;

Just adding an space to the end of the string solves the problem:
json test = R"({ "a": "b) "})"_json;

Reproduction steps

just add the above code to any part of your program.

Expected vs. actual results

The string will be threated as string instead to threat the parenthesis as a end of the JSON raw data.

Minimal code example

`json test = R"({ "a": "b)"})"_json;`

Error messages

The errors are similar to when you forgot to close a string or simililar. All the code below the above example gives sintax error. Even the Visual Studio Code intellisense starts to work wrongly and the formatter breaks the format of the json.

Compiler and operating system

Microsoft (R) Build Engine versión 17.1.0+ae57d105c para .NET Framework on Windows 11

Library version

3.10.5

Validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions