From 7c9215f958258fa78df0e8e2994d69ce5f8d82b6 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Wed, 5 Apr 2023 13:11:44 +0800 Subject: [PATCH] PR #2189 - Follow-up: Fix build bustage with GCC 9 related to checkExportedNamesForDeclaration --- js/src/frontend/Parser.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 1f92256a33..d5cdd898c2 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -5235,6 +5235,33 @@ Parser::checkExportedName(JSAtom* exportName) return false; } +// Because all these template methods call each other, let's declare them first before +// defining them to prevent a GCC compiler error in specialization of member function +// template after instantiation. +template<> +bool +Parser::checkExportedNamesForDeclaration(ParseNode* node); + +template<> +bool +Parser::checkExportedNamesForDeclaration(Node node); + +template<> +bool +Parser::checkExportedNamesForArrayBinding(ListNode* array); + +template<> +inline bool +Parser::checkExportedNamesForArrayBinding(ListNodeType array); + +template<> +bool +Parser::checkExportedNamesForObjectBinding(ListNode* obj); + +template<> +inline bool +Parser::checkExportedNamesForObjectBinding(ListNodeType obj); + template<> bool Parser::checkExportedNamesForArrayBinding(ListNode* array)