Skip to content

Commit c31320d

Browse files
committed
Add note about why we're emitting requires-clauses on the function body because of GCC 10.x
1 parent 3e5a83a commit c31320d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

source/cppfront.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4643,6 +4643,8 @@ class cppfront
46434643
}
46444644
}
46454645

4646+
// *** LOCATION (A) -- SEE NOTE REGARDING (A) BELOW
4647+
46464648
// End function declaration
46474649
if (printer.doing_declarations_only()) {
46484650
printer.print_cpp2( ";\n", n.position() );
@@ -4731,7 +4733,17 @@ class cppfront
47314733

47324734
printer.preempt_position_push( n.equal_sign );
47334735

4734-
// Handle requires expression - an explicit one plus any generated
4736+
// *** NOTE: This branch to emit the requires-clause should maybe be
4737+
// moved to location (A) above, so that it's also emitted
4738+
// on the function declaration. But doing that triggers a
4739+
// bug in GCC 10.x (that was fixed in 11.x), and 10.x is
4740+
// my main test compiler and works for everything else,
4741+
// and moving it up there would break 'forward' parameters
4742+
// with concrete types on GCC 10.x.
4743+
// So I'm not yet moving this code up to the declaration,
4744+
// given that so far things appear to be working well enough
4745+
// with the requires-clause on the function definition only...
4746+
// Handle requires clause - an explicit one plus any generated
47354747
// from processing the parameters
47364748
if (
47374749
n.requires_clause_expression

0 commit comments

Comments
 (0)