File tree 6 files changed +21
-18
lines changed
regression-tests/test-results
6 files changed +21
-18
lines changed Original file line number Diff line number Diff line change 1
1
2
- cppfront compiler v0.2.1 Build 8928:1358
2
+ cppfront compiler v0.2.1 Build 8930:0819
3
3
Copyright(c) Herb Sutter All rights reserved
4
4
5
5
SPDX-License-Identifier: CC-BY-NC-ND-4.0
Original file line number Diff line number Diff line change 1
- "8928:1431 "
1
+ "8930:0819 "
Original file line number Diff line number Diff line change @@ -7981,6 +7981,23 @@ class parser
7981
7981
}
7982
7982
}
7983
7983
7984
+ // A type initializer must be a compound expression
7985
+ if (
7986
+ n->is_type ()
7987
+ && !is_parameter
7988
+ && (
7989
+ !n->initializer
7990
+ || !n->initializer ->is_compound ()
7991
+ )
7992
+ )
7993
+ {
7994
+ errors.emplace_back (
7995
+ n->position (),
7996
+ " a user-defined type initializer must be a compound-expression consisting of declarations"
7997
+ );
7998
+ return {};
7999
+ }
8000
+
7984
8001
// If this is a type with metafunctions, apply those
7985
8002
if (n->is_type ()) {
7986
8003
if (!apply_type_metafunctions (*n)) {
Original file line number Diff line number Diff line change @@ -937,7 +937,7 @@ declaration_base::declaration_base(declaration_base const& that)
937
937
auto declaration::mark_for_removal_from_enclosing_type () & -> void
938
938
939
939
{
940
- cpp2::Default .expects (parent_is_type (), " " );
940
+ cpp2::Type .expects (parent_is_type (), " " );
941
941
#line 285 "reflect.h2"
942
942
auto test {CPP2_UFCS_0 (type_member_mark_for_removal, (*cpp2::assert_not_null (n)))};
943
943
cpp2::Default.expects (std::move (test), " " ); // ... to ensure this assert is true
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ declaration: @polymorphic_base @copyable type =
280
280
parent_is_polymorphic: (this) -> bool = n*.parent_is_polymorphic();
281
281
282
282
mark_for_removal_from_enclosing_type: (inout this)
283
- [[pre: parent_is_type()]] // this precondition should be sufficient ...
283
+ [[pre Type : parent_is_type()]] // this precondition should be sufficient ...
284
284
= {
285
285
test := n*.type_member_mark_for_removal();
286
286
[[assert: test]] // ... to ensure this assert is true
Original file line number Diff line number Diff line change @@ -1031,20 +1031,6 @@ class sema
1031
1031
return false ;
1032
1032
}
1033
1033
1034
- // A type initializer must be a compound expression
1035
- if (
1036
- n.is_type ()
1037
- && n.initializer
1038
- && !n.initializer ->is_compound ()
1039
- )
1040
- {
1041
- errors.emplace_back (
1042
- n.position (),
1043
- " a user-defined type initializer must be a compound-expression consisting of declarations"
1044
- );
1045
- return false ;
1046
- }
1047
-
1048
1034
// A namespace must be initialized with a compound expression
1049
1035
if (
1050
1036
n.is_namespace ()
You can’t perform that action at this time.
0 commit comments