Skip to content

Commit 06a1cc6

Browse files
committed
Use private qualifier for fortran:private
Instead of entirely omitting member functions from the class interface.
1 parent 4f03616 commit 06a1cc6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/Modules/fortran.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,9 +1133,7 @@ int FORTRAN::functionWrapper(Node *n) {
11331133

11341134
// >>> GENERATE CODE FOR MODULE INTERFACE
11351135

1136-
if (GetFlag(n, "fortran:private")) {
1137-
// Hidden function (currently, only constructors that become module procedures)
1138-
} else if (member) {
1136+
if (member) {
11391137
// Wrapping a member function
11401138
ASSERT_OR_PRINT_NODE(!this->is_bindc_struct(), n);
11411139
ASSERT_OR_PRINT_NODE(f_class, n);
@@ -1144,7 +1142,7 @@ int FORTRAN::functionWrapper(Node *n) {
11441142

11451143
String *qualifiers = NewStringEmpty();
11461144

1147-
if (generic) {
1145+
if (generic || GetFlag(n, "fortran:private")) {
11481146
Append(qualifiers, ", private");
11491147
}
11501148
if (String *extra_quals = Getattr(n, "fortran:procedure")) {
@@ -1169,6 +1167,8 @@ int FORTRAN::functionWrapper(Node *n) {
11691167
// Declare a private procedure
11701168
Printv(f_class, fname, "\n", NULL);
11711169
}
1170+
} else if (GetFlag(n, "fortran:private")) {
1171+
/* Don't write the public accessor */
11721172
} else if (fsymname) {
11731173
// The module function name is aliased, and perhaps overloaded.
11741174
// Append this function name to the list of overloaded names

0 commit comments

Comments
 (0)