public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67208] New: bool const to float* function argument allowed
@ 2015-08-13 16:14 andrew.larson@cpfd-software.com
  2015-08-13 16:17 ` [Bug c++/67208] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: andrew.larson@cpfd-software.com @ 2015-08-13 16:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67208
           Summary: bool const to float* function argument allowed
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andrew.larson@cpfd-software.com
  Target Milestone: ---

Created attachment 36182
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36182&action=edit
Example to compile and run to see said behavior.

See attachment for repo.
(1)  Passing a bool const variable to function(float*) compiles.
(2)  Passing a bool variable to function(float*) does not compile.

Compiler should treat (1) as an error.


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

* [Bug c++/67208] bool const to float* function argument allowed
  2015-08-13 16:14 [Bug c++/67208] New: bool const to float* function argument allowed andrew.larson@cpfd-software.com
@ 2015-08-13 16:17 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2015-08-13 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC 4.6 has not been supported for some years, so reporting bugs against it
here is not going to change anything.

Your code is valid in C++03, but not C++11.

It is correctly rejected by GCC 4.7+ in C++11 mode:

main.cpp:11:14: error: cannot convert ‘const bool’ to ‘float*’ for argument ‘1’
to ‘void function(float*)’
>From gcc-bugs-return-494785-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Aug 13 16:25:38 2015
Return-Path: <gcc-bugs-return-494785-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27549 invoked by alias); 13 Aug 2015 16:25:38 -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 27494 invoked by uid 48); 13 Aug 2015 16:25:34 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274
Date: Thu, 13 Aug 2015 16:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status assigned_to target_milestone
Message-ID: <bug-67133-4-cTGgJtTUqb@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67133-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67133-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-08/txt/msg00927.txt.bz2
Content-length: 821

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |6.0

--- Comment #15 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The ICE in description with -Os -fisolate-erroneous-paths-dereference
-fisolate-erroneous-paths-attribute started with r220417.  I think it's pretty
clear that the new maybe_remove_unused_call_args function removes arguments,
but doesn't drop the nonnull attribute.

All right, let me look into both of these issues.


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-13 16:14 [Bug c++/67208] New: bool const to float* function argument allowed andrew.larson@cpfd-software.com
2015-08-13 16:17 ` [Bug c++/67208] " redi 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).