Skip to content

Commit 479a345

Browse files
committed
Allow _ as "don't care" shorthand for the Default contract group
Since now we might want to write flags afterwards, e.g., `<Group, flag1, flag2>`, programmers who want the default group `<Default, flag1, flag2>` might expect to be able to equivalently write `<_, flag1, flag2>`, so let's make that work Until now, programmers would just omit `<Default>` and that continues the work as the basic default, as before
1 parent c119d32 commit 479a345

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/to_cpp1.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4536,7 +4536,10 @@ class cppfront
45364536
auto name = std::string{"cpp2::Default"};
45374537
if (n.group)
45384538
{
4539-
name = print_to_string(*n.group);
4539+
auto group = print_to_string(*n.group);
4540+
if (group != "_") {
4541+
name = group;
4542+
}
45404543
if (
45414544
name == "Default"
45424545
|| name == "Bounds"

0 commit comments

Comments
 (0)