public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "other+gcc at meresinski dot eu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67961] New: Incorrect type of meber of struct in error message
Date: Wed, 14 Oct 2015 08:48:00 -0000	[thread overview]
Message-ID: <bug-67961-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 67961
           Summary: Incorrect type of meber of struct in error message
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: other+gcc at meresinski dot eu
  Target Milestone: ---

Created attachment 36506
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36506&action=edit
Test case

Compiling following code produces incorrect error message:

#include <cstdint>

void foo(std::size_t &f) {
        f = 5;
}

struct A {
        uint32_t val;
};

int main() {
        A a, *aptr = &a;
        foo(aptr->val);
        return 0;
}

g++ --std=c++11 foo.cpp gives error message:
error: invalid initialization of non-const reference of type ‘std::size_t& {aka
long unsigned int&}’ from an rvalue of type ‘std::size_t {aka long unsigned
int}’
  foo(aptr->val);
            ^
where type of that rvalue variable is uint32_t not std::size_t. I think I
should add that system is 64bit so std::size_t has 64 bits.
>From gcc-bugs-return-499522-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 14 09:37:24 2015
Return-Path: <gcc-bugs-return-499522-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24867 invoked by alias); 14 Oct 2015 09:37:24 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 24804 invoked by uid 48); 14 Oct 2015 09:37:19 -0000
From: "ienkovich at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/67920] [6 Regression] wrong code with -O3
Date: Wed, 14 Oct 2015 09:37:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ienkovich at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-67920-4-Isd0g5AQ0R@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67920-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67920-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg01077.txt.bz2
Content-length: 507

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg920

Ilya Enkovich <ienkovich at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
(In reply to James Almer from comment #9)
> Looks like it did. Thanks.

Fixed then


             reply	other threads:[~2015-10-14  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14  8:48 other+gcc at meresinski dot eu [this message]
2015-10-14 14:14 ` [Bug c++/67961] " redi at gcc dot gnu.org
2015-10-14 14:26 ` redi at gcc dot gnu.org
2015-10-15  9:11 ` paolo.carlini at oracle dot com

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-67961-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).