aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/expressions.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-02-08 20:19:04 -0800
committerIan Lance Taylor <iant@golang.org>2022-02-09 14:15:41 -0800
commite50a79552d567cd49703103d478ab93d805f60c1 (patch)
treeb549784cb82e06317096c8e7f456d9bf26ed4ea2 /gcc/go/gofrontend/expressions.cc
parent2e2b861e8941c4e9b36b88e9c562642b1aba6eaf (diff)
downloadgcc-e50a79552d567cd49703103d478ab93d805f60c1.zip
gcc-e50a79552d567cd49703103d478ab93d805f60c1.tar.gz
gcc-e50a79552d567cd49703103d478ab93d805f60c1.tar.bz2
compiler: don't warn for print()
We used to warn for calls to print(), because it doesn't do anything. However, a Go 1.18 test uses that call, and it is valid Go. Change the compiler to just accept it and compile it; this will produce calls to printlock and printunlock, and nothing else. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384355
Diffstat (limited to 'gcc/go/gofrontend/expressions.cc')
-rw-r--r--gcc/go/gofrontend/expressions.cc11
1 files changed, 1 insertions, 10 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 3f59765..1b3b3bf 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -10332,16 +10332,7 @@ Builtin_call_expression::do_check_types(Gogo*)
case BUILTIN_PRINTLN:
{
const Expression_list* args = this->args();
- if (args == NULL)
- {
- if (this->code_ == BUILTIN_PRINT)
- go_warning_at(this->location(), 0,
- "no arguments for built-in function %<%s%>",
- (this->code_ == BUILTIN_PRINT
- ? "print"
- : "println"));
- }
- else
+ if (args != NULL)
{
for (Expression_list::const_iterator p = args->begin();
p != args->end();