public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95744] New: Duplicate error message in a simple decltype specifier
@ 2020-06-18 14:29 haoxintu at gmail dot com
  2020-06-18 15:09 ` [Bug c++/95744] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: haoxintu at gmail dot com @ 2020-06-18 14:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95744

            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 undeclared
variable(I am definitely sure), but GCC emits two duplicated error messages on
it.

$cat test.cc
decltype(var) i = 100;

$g++-trunk -c -w test.cc
test.cc:1:10: error: ‘var’ was not declared in this scope
    1 | decltype(var) i = 100;
      |          ^~~
test.cc:1:10: error: ‘var’ 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 = 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/95744] Duplicate error message in a simple decltype specifier
  2020-06-18 14:29 [Bug c++/95744] New: Duplicate error message in a simple decltype specifier haoxintu at gmail dot com
@ 2020-06-18 15:09 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-18 15:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95744

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-06-18
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-18 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18 14:29 [Bug c++/95744] New: Duplicate error message in a simple decltype specifier haoxintu at gmail dot com
2020-06-18 15:09 ` [Bug c++/95744] " mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).