This patch to the Go frontend changes traversal to always traverse
method declarations (method definitions were already traversed). This
removes one existing case that explicitly traversed method
declarations, in favor of the common approach.
Note that the gc Go compiler rejects method declarations, and maybe
the Go frontend should too. But not today.
This avoids a compiler crash (
https://gcc.gnu.org/PR117891) if there
are method declarations with types that require specific functions. I
didn't bother with a test case because a program with method
declarations is almost certainly invalid anyhow.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed
to mainline.
Ian