public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108578] New: typedef inside a struct error message should be improved
@ 2023-01-27 21:53 pinskia at gcc dot gnu.org
  2023-01-27 21:54 ` [Bug c/108578] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-27 21:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108578
           Summary: typedef inside a struct error message should be
                    improved
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
struct f {
  typedef int t;
};
```
Currently the C front-end (it is valid C++) gives:
```
<source>:2:3: error: expected specifier-qualifier-list before 'typedef'
    2 |   typedef int t;
      |   ^~~~~~~
```

This error message is correct but the C front-end could mention that something
like typedefs inside the struct scope is not allowed.

clang gives slightly better error message:
```
<source>:2:3: error: type name does not allow storage class to be specified
  typedef int t;
  ^
```

replacing typedef with static gives the same bad error mesage.

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

* [Bug c/108578] typedef inside a struct error message should be improved
  2023-01-27 21:53 [Bug c/108578] New: typedef inside a struct error message should be improved pinskia at gcc dot gnu.org
@ 2023-01-27 21:54 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-27 21:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

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

end of thread, other threads:[~2023-01-27 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 21:53 [Bug c/108578] New: typedef inside a struct error message should be improved pinskia at gcc dot gnu.org
2023-01-27 21:54 ` [Bug c/108578] " 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).