diff --git a/compiler/resolution/cullOverReferences.cpp b/compiler/resolution/cullOverReferences.cpp index 7d871802f7a4..e2292767d1e0 100644 --- a/compiler/resolution/cullOverReferences.cpp +++ b/compiler/resolution/cullOverReferences.cpp @@ -505,9 +505,15 @@ static void maybeIssueRefMaybeConstWarning(ArgSymbol* arg) { argName = arg->name; } - const char* intentName = isTaskIntent ? "add an explicit task variable for" : (isArgThis ? "use an explicit this intent for the method" : "use an explicit intent for the argument"); - - Symbol* warnSym = (isTaskIntent && arg->getFunction()) ? (Symbol*)arg->getFunction() : (Symbol*)arg; + const char* intentName = isTaskIntent ? + "add an explicit 'ref' task intent for" : + (isArgThis ? + "use an explicit 'ref' this intent for the method" : + "use an explicit 'ref' intent for the argument"); + + bool useFunctionForWarning = isTaskIntent && arg->getFunction(); + Symbol* warnSym = + useFunctionForWarning ? (Symbol*)arg->getFunction() : (Symbol*)arg; USR_WARN(warnSym, "inferring a default intent to be 'ref' is deprecated " "- please %s '%s'", diff --git a/test/deprecated/ref-maybe-const-task-intent.good b/test/deprecated/ref-maybe-const-task-intent.good index 37ff579f17dd..e0cd54988112 100644 --- a/test/deprecated/ref-maybe-const-task-intent.good +++ b/test/deprecated/ref-maybe-const-task-intent.good @@ -1,7 +1,7 @@ -ref-maybe-const-task-intent.chpl:2: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'y' -ref-maybe-const-task-intent.chpl:8: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'z' -ref-maybe-const-task-intent.chpl:9: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'z' -ref-maybe-const-task-intent.chpl:14: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'w' -ref-maybe-const-task-intent.chpl:24: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'x' -ref-maybe-const-task-intent.chpl:25: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'y' -ref-maybe-const-task-intent.chpl:36: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'this' +ref-maybe-const-task-intent.chpl:2: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'y' +ref-maybe-const-task-intent.chpl:8: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'z' +ref-maybe-const-task-intent.chpl:9: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'z' +ref-maybe-const-task-intent.chpl:14: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'w' +ref-maybe-const-task-intent.chpl:24: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'x' +ref-maybe-const-task-intent.chpl:25: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'y' +ref-maybe-const-task-intent.chpl:36: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'this' diff --git a/test/deprecated/ref-maybe-const.good b/test/deprecated/ref-maybe-const.good index 8f575c3b175e..dcd2c0b49985 100644 --- a/test/deprecated/ref-maybe-const.good +++ b/test/deprecated/ref-maybe-const.good @@ -1,5 +1,5 @@ -ref-maybe-const.chpl:7: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit intent for the argument 'A' -ref-maybe-const.chpl:12: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit intent for the argument 'args' +ref-maybe-const.chpl:7: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit 'ref' intent for the argument 'A' +ref-maybe-const.chpl:12: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit 'ref' intent for the argument 'args' A, 1 2 3 4 5 6 7 8 9 10 B, 1 2 3 4 5 6 7 8 9 10 A, 1 1 1 1 1 1 1 1 1 1 diff --git a/test/studies/cholesky/marybeth/chol.chpl b/test/studies/cholesky/marybeth/chol.chpl index 32b45f5dea53..1588f4d95cc0 100644 --- a/test/studies/cholesky/marybeth/chol.chpl +++ b/test/studies/cholesky/marybeth/chol.chpl @@ -27,7 +27,7 @@ proc main() { chol(A); -writeln("Factored Matrix:"); + writeln("Factored Matrix:"); writelower(A); writeln(); }