public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65598] New: Misleading error message for out-of-class definition of explicit conversion operator
@ 2015-03-27 10:29 arvo at me dot com
  2015-03-27 11:17 ` [Bug c++/65598] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: arvo at me dot com @ 2015-03-27 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65598
           Summary: Misleading error message for out-of-class definition
                    of explicit conversion operator
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arvo at me dot com

Created attachment 35160
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35160&action=edit
Preprocessed source

System report:
OS: GNU/Linux x86_64
Distribution: openSUSE 13.1
Package info:
  Informationen für Paket gcc49-c++:
  ----------------------------------
  Repository: @System
  Name: gcc49-c++
  Version: 4.9.1+r213409-44.1
  Arch: x86_64
  Anbieter: obs://build.opensuse.org/devel:gcc
  Installiert: Ja
  Status: aktuell
  Installierte Größe: 17,3 MiB
  Zusammenfassung: The GNU C++ Compiler
  Beschreibung: 
  This package contains the GNU compiler for C++.


Test program (C++11):

  struct ExplicitTest
  {
      explicit operator bool() const;
  };

  explicit ExplicitTest::operator bool() const
  {
      return true;
  }

The program is ill-formed because explicit is only allowed inside a class
definition, as per §7.1.2/6 Function Specifiers [N3376]. However, the error
message is misleading and seems not to have been updated for C++11, where
explicit conversion operators were introduced:

$ g++-4.9 -c -std=c++11 explicit_operator_bool.cxx
explicit_operator_bool.cxx:6:40: error: only declarations of constructors can
be ‘explicit’
 explicit ExplicitTest::operator bool() const
                                        ^

(Also it would probably be better to place the caret underneath "explicit".)
>From gcc-bugs-return-481972-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 27 10:06:44 2015
Return-Path: <gcc-bugs-return-481972-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26028 invoked by alias); 27 Mar 2015 10:06:44 -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 25327 invoked by uid 48); 27 Mar 2015 10:06:40 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/65597] ICE in build_outer_var_ref, at omp-low.c:1043
Date: Fri, 27 Mar 2015 10:30: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: 5.0
X-Bugzilla-Keywords: openmp
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dominiq at lps dot ens.fr
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-65597-4-OIgwwu152R@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65597-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65597-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-03/txt/msg03116.txt.bz2
Content-length: 516

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-27
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed since at least r210749.


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

end of thread, other threads:[~2015-05-22 14:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-27 10:29 [Bug c++/65598] New: Misleading error message for out-of-class definition of explicit conversion operator arvo at me dot com
2015-03-27 11:17 ` [Bug c++/65598] " redi at gcc dot gnu.org
2015-03-27 11:29 ` redi at gcc dot gnu.org
2015-03-27 13:15 ` [Bug c++/65598] Fix column location for 'explicit' manu at gcc dot gnu.org
2015-04-22 11:57 ` jakub at gcc dot gnu.org
2015-05-22 11:03 ` paolo.carlini at oracle dot com
2015-05-22 14:15 ` paolo.carlini at oracle dot com
2015-05-22 14:15 ` paolo 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).