Skip to content

Commit 6eb362e

Browse files
committed
Fix check for _ as an allowed member name, closes #851
1 parent 9aefcee commit 6eb362e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

regression-tests/test-results/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
cppfront compiler v0.3.0 Build 8C28:1634
2+
cppfront compiler v0.3.0 Build 9104:1031
33
Copyright(c) Herb Sutter All rights reserved
44

55
SPDX-License-Identifier: CC-BY-NC-ND-4.0

source/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"8C28:1634"
1+
"9104:1031"

source/reflect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,7 @@ auto print(cpp2::in<meta::type_declaration> t) -> void
18711871
for (
18721872
auto const& m : CPP2_UFCS(get_members)(rtype) )
18731873
{
1874-
CPP2_UFCS(require)(m, !(CPP2_UFCS(starts_with)(CPP2_UFCS(name)(m), "_")) || cpp2::cmp_greater(CPP2_UFCS(ssize)(CPP2_UFCS(name)(m)),1),
1874+
CPP2_UFCS(require)(m, !(CPP2_UFCS(starts_with)(CPP2_UFCS(name)(m), "_")) || CPP2_UFCS(ssize)(CPP2_UFCS(name)(m)) == 1,
18751875
"a type that applies a metafunction cannot have a body that declares a name that starts with '_' - those names are reserved for the metafunction implementation");
18761876
}
18771877

source/reflect.h2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ apply_metafunctions: (
13551355
for rtype.get_members()
13561356
do (m)
13571357
{
1358-
m.require( !m.name().starts_with("_") || m.name().ssize() > 1,
1358+
m.require( !m.name().starts_with("_") || m.name().ssize() == 1,
13591359
"a type that applies a metafunction cannot have a body that declares a name that starts with '_' - those names are reserved for the metafunction implementation");
13601360
}
13611361

0 commit comments

Comments
 (0)