public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57883] New: Feature request: better diagnostic for unknown type
@ 2013-07-11 21:06 dushistov at mail dot ru
  2013-11-09 22:29 ` [Bug c++/57883] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dushistov at mail dot ru @ 2013-07-11 21:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57883

            Bug ID: 57883
           Summary: Feature request: better diagnostic for unknown type
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dushistov at mail dot ru

$cat test.cpp
//#include <cstddef>
struct vec {
    double x;
    double y;
    double z;

    double& operator[](size_t i) {
        switch (i) {
        case 0:
            return x;
        case 1:
            return y;
        case 2:
            return z;
        }
    }
};

g++ -c -Wall -std=c++11 test.cpp
test.cpp:8:21: error: declaration of 'operator[]' as non-function
  double& operator[](size_t i) {

plus more not related errors 
...

This is completly wrong message, but at the same time 
clang++ -c -Wall -std=c++11 test.cpp
test.cpp:8:21: error: unknown type name 'size_t'
        double& operator[](size_t i) {
                           ^
1 error generated.

It will be good if gcc also can give error with message that size_t undefined.


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

end of thread, other threads:[~2021-09-28 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-11 21:06 [Bug c++/57883] New: Feature request: better diagnostic for unknown type dushistov at mail dot ru
2013-11-09 22:29 ` [Bug c++/57883] " pinskia at gcc dot gnu.org
2021-09-28  9:53 ` pinskia at gcc dot gnu.org
2021-09-28 10:47 ` redi at gcc dot gnu.org
2021-09-28 10:48 ` redi at gcc dot gnu.org
2021-09-28 19:12 ` 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).