From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 48E47388E836; Thu, 18 Jun 2020 14:29:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48E47388E836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592490580; bh=BixvJmza4LePAQPaQM/Qg4bK3X8+CCgN02WQJHBY0a4=; h=From:To:Subject:Date:From; b=q0CfpVv6spFZELaWpsWnvJDrclp0KIUV7vJ3tBD2lm/MuQt460JNcR1/jg8CRHdMu uMNXipDg4oKEcS+o2KM9X+3fDnNcnABSCzC3wNKzBVnFkIDJPnrL61pqTFaEkJYWFg Y3Sje9lZS0WCEgd6gcHQWHIiG28FySooauC5e6tk= From: "haoxintu at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95744] New: Duplicate error message in a simple decltype specifier Date: Thu, 18 Jun 2020 14:29:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: haoxintu at gmail dot com 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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: Thu, 18 Jun 2020 14:29:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95744 Bug ID: 95744 Summary: Duplicate error message in a simple decltype specifier Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: mpolacek at gcc dot gnu.org, redi at gcc dot gnu.org Target Milestone: --- The test.cc includes a very simple valid decltype specifier with an undecla= red variable(I am definitely sure), but GCC emits two duplicated error messages= on it. $cat test.cc decltype(var) i =3D 100; $g++-trunk -c -w test.cc test.cc:1:10: error: =E2=80=98var=E2=80=99 was not declared in this scope 1 | decltype(var) i =3D 100; | ^~~ test.cc:1:10: error: =E2=80=98var=E2=80=99 was not declared in this scope While in clang $clang++ -c -w test.cc test.cc:1:10: error: use of undeclared identifier 'var' decltype(var) i =3D 100; ^ 1 error generated. My GCC version is $g++-trunk --version g++ (GCC) 11.0.0 20200605 (experimental) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=