File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -4457,20 +4457,20 @@ class cppfront
4457
4457
}
4458
4458
}
4459
4459
4460
- if (n. access ) {
4461
- assert (is_in_type);
4462
- printer.print_cpp2 (n. access -> to_string ( true ) + " : " , n. access -> position ());
4463
- }
4464
- else if (
4465
- is_in_type
4466
- && printer. get_phase () == printer. phase1_type_defs_func_decls
4467
- )
4468
- {
4469
- if (n. is_object ()) {
4470
- printer. print_cpp2 ( " private: " , n. position ());
4471
- }
4472
- else {
4473
- printer. print_cpp2 ( " public: " , n. position ());
4460
+ // In class definitions, emit the explicit access specifier if there
4461
+ // is one, or default to private for data and public for functions
4462
+ if ( printer.get_phase () == printer. phase1_type_defs_func_decls ) {
4463
+ if (n. access ) {
4464
+ assert (is_in_type);
4465
+ printer. print_cpp2 (n. access -> to_string ( true ) + " : " , n. access -> position ());
4466
+ }
4467
+ else if (is_in_type) {
4468
+ if (n. is_object ()) {
4469
+ printer. print_cpp2 ( " private: " , n. position ());
4470
+ }
4471
+ else {
4472
+ printer. print_cpp2 ( " public: " , n. position ());
4473
+ }
4474
4474
}
4475
4475
}
4476
4476
You can’t perform that action at this time.
0 commit comments