Skip to content

[BUG] Raw string with {} doesn't parse #841

@JohelEGP

Description

@JohelEGP

Title: Raw string with {} doesn't parse.

Minimal reproducer (https://cpp2.godbolt.org/z/aPbMedenM):

main: () = {
  _ = R"({
  })";
}
Commands:
cppfront main.cpp2
clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cpp

Expected result: A well-formed string literal.

Actual result and error:

main.cpp2...
main.cpp2(4,0): error: closing } does not match a prior {
main.cpp2: error: unexpected end of source file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions