public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95657] New: Bogus error message in "auto" with -std=c++11
@ 2020-06-12 14:42 haoxintu at gmail dot com
  2020-06-15 10:00 ` [Bug c++/95657] Duplicate error messages for decltype(auto) " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: haoxintu at gmail dot com @ 2020-06-12 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95657
           Summary: Bogus error message in "auto" with -std=c++11
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

This code bug.cc

decltype (auto) foo( decltype (auto) a ){   }

in GCC-trunk

$g++ -c -std=c++11 bug.cc
bug.cc:1:11: error: expected primary-expression before ‘auto’
    1 | decltype (auto) foo( decltype  (auto) a ){   }
      |           ^~~~
bug.cc:1:33: error: use of ‘auto’ in parameter declaration only available with
‘-std=c++14’ or ‘-std=gnu++14’
    1 | decltype (auto) foo( decltype  (auto) a ){   }
      |                                 ^~~~
bug.cc:1:33: error: use of ‘auto’ in parameter declaration only available with
‘-std=c++14’ or ‘-std=gnu++14’
bug.cc:1:33: error: use of ‘auto’ in parameter declaration only available with
‘-std=c++14’ or ‘-std=gnu++14’
bug.cc:1:33: error: use of ‘auto’ in parameter declaration only available with
‘-std=c++14’ or ‘-std=gnu++14’
bug.cc:1:33: error: use of ‘auto’ in parameter declaration only available with
‘-std=c++14’ or ‘-std=gnu++14’
bug.cc:1:33: error: use of ‘auto’ in parameter declaration only available with
‘-std=c++14’ or ‘-std=gnu++14’
bug.cc:1:33: error: expected primary-expression before ‘auto’
bug.cc:1:22: error: expected primary-expression before ‘decltype’
    1 | decltype (auto) foo( decltype  (auto) a ){   }
      |                      ^~~~~~~~~~~~~~~~

I am sure there were some duplicate error messages about "error: use of ‘auto’
in parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’".

While in clang

$clang++ -c -std=c++11 bug.cc
bug.cc:1:11: warning: 'decltype(auto)' type specifier is a C++14 extension
[-Wc++14-extensions]
decltype (auto) foo( decltype  (auto) a ){   }
          ^
bug.cc:1:33: warning: 'decltype(auto)' type specifier is a C++14 extension
[-Wc++14-extensions]
decltype (auto) foo( decltype  (auto) a ){   }
                                ^
bug.cc:1:22: error: 'decltype(auto)' not allowed in function prototype
decltype (auto) foo( decltype  (auto) a ){   }
                     ^~~~~~~~
bug.cc:1:1: error: deduced return types are a C++14 extension
decltype (auto) foo( decltype  (auto) a ){   }
^
2 warnings and 2 errors generated.

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

* [Bug c++/95657] Duplicate error messages for decltype(auto) with -std=c++11
  2020-06-12 14:42 [Bug c++/95657] New: Bogus error message in "auto" with -std=c++11 haoxintu at gmail dot com
@ 2020-06-15 10:00 ` redi at gcc dot gnu.org
  2021-09-07 17:12 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2020-06-15 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-06-15
            Summary|Bogus error message in      |Duplicate error messages
                   |"auto" with -std=c++11      |for decltype(auto) with
                   |                            |-std=c++11
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The error isn't bogus, it's just shown too many times.

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

* [Bug c++/95657] Duplicate error messages for decltype(auto) with -std=c++11
  2020-06-12 14:42 [Bug c++/95657] New: Bogus error message in "auto" with -std=c++11 haoxintu at gmail dot com
  2020-06-15 10:00 ` [Bug c++/95657] Duplicate error messages for decltype(auto) " redi at gcc dot gnu.org
@ 2021-09-07 17:12 ` pinskia at gcc dot gnu.org
  2021-12-08 14:38 ` marxin at gcc dot gnu.org
  2021-12-08 16:17 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-07 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looks fixed in GCC 11:
<source>:1:1: error: 'decltype(auto)' type specifier only available with
'-std=c++14' or '-std=gnu++14'
    1 | decltype (auto) foo( decltype (auto) a ){   }
      | ^~~~~~~~
<source>:1:22: error: 'decltype(auto)' type specifier only available with
'-std=c++14' or '-std=gnu++14'
    1 | decltype (auto) foo( decltype (auto) a ){   }
      |                      ^~~~~~~~
<source>:1:38: error: expected initializer before 'a'
    1 | decltype (auto) foo( decltype (auto) a ){   }
      |                                      ^

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

* [Bug c++/95657] Duplicate error messages for decltype(auto) with -std=c++11
  2020-06-12 14:42 [Bug c++/95657] New: Bogus error message in "auto" with -std=c++11 haoxintu at gmail dot com
  2020-06-15 10:00 ` [Bug c++/95657] Duplicate error messages for decltype(auto) " redi at gcc dot gnu.org
  2021-09-07 17:12 ` pinskia at gcc dot gnu.org
@ 2021-12-08 14:38 ` marxin at gcc dot gnu.org
  2021-12-08 16:17 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-08 14:38 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=96103
           Keywords|needs-bisection             |
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed in r11-1913-ga51de1af063b0a92.

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

* [Bug c++/95657] Duplicate error messages for decltype(auto) with -std=c++11
  2020-06-12 14:42 [Bug c++/95657] New: Bogus error message in "auto" with -std=c++11 haoxintu at gmail dot com
                   ` (2 preceding siblings ...)
  2021-12-08 14:38 ` marxin at gcc dot gnu.org
@ 2021-12-08 16:17 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-08 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |11.0

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #3)
> Fixed in r11-1913-ga51de1af063b0a92.

So the fix was by design of the patch so closing as fixed.

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

end of thread, other threads:[~2021-12-08 16:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 14:42 [Bug c++/95657] New: Bogus error message in "auto" with -std=c++11 haoxintu at gmail dot com
2020-06-15 10:00 ` [Bug c++/95657] Duplicate error messages for decltype(auto) " redi at gcc dot gnu.org
2021-09-07 17:12 ` pinskia at gcc dot gnu.org
2021-12-08 14:38 ` marxin at gcc dot gnu.org
2021-12-08 16:17 ` pinskia 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).