From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 81B3B3861899; Sat, 28 Nov 2020 12:18:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81B3B3861899 From: "tangyixuan at mail dot dlut.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98031] missing the error message of undeclared label Date: Sat, 28 Nov 2020 12:18:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: tangyixuan at mail dot dlut.edu.cn X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 12:18:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98031 --- Comment #2 from tangyixuan --- (In reply to Jakub Jelinek from comment #1) > This is again diagnostics on uninstantiated template, invalid, no > diagnostics required. > Instantiate the template and it will be diagnosed. Yeah, I agree with you. If we correct the second error (i.e., lab1(1) -> fun(1)), there is a error diagnostic for the first error as below: s.cpp:4:36: error: label =E2=80=98lab2=E2=80=99 used but not defined 4 | static void* labs[2] =3D { &&lab1, &&lab2 }; | ^~~~~~ The convenient thing is that if the compiler reports the two programming mistakes (real errors) at one compilation time could be better, so as to sa= ve the developers' time I guess.=