public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dushistov at mail dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57883] New: Feature request: better diagnostic for unknown type
Date: Thu, 11 Jul 2013 21:06:00 -0000	[thread overview]
Message-ID: <bug-57883-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2013-07-11 21:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 21:06 dushistov at mail dot ru [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-57883-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).