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

* [Bug c++/65598] Misleading error message for out-of-class definition of explicit conversion operator
  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 ` redi at gcc dot gnu.org
  2015-03-27 11:29 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-27 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC 5 says:

e.cc:6:42: error: ‘explicit’ outside class declaration
   explicit ExplicitTest::operator bool() const
                                          ^

(The caret position is a well known issue with all error locations, there is
work being done to improve things.)
>From gcc-bugs-return-481983-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 27 11:00:40 2015
Return-Path: <gcc-bugs-return-481983-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 126061 invoked by alias); 27 Mar 2015 11:00:40 -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 125704 invoked by uid 48); 27 Mar 2015 11:00:32 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/65594] libgomp.graphite/force-parallel-6.c timeout
Date: Fri, 27 Mar 2015 11:22:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: testsuite
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
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:
Message-ID: <bug-65594-4-2EpMO6W5nb@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65594-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65594-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/msg03127.txt.bz2
Content-length: 262

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And use M instead of N in the outer two loops and define M to something lower
(100, 50 or similar)?  The test doesn't verify the result anyway.


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

* [Bug c++/65598] Misleading error message for out-of-class definition of explicit conversion operator
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-27 11:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |DUPLICATE

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Dup

*** This bug has been marked as a duplicate of bug 60686 ***


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

* [Bug c++/65598] Fix column location for 'explicit'
  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 ` manu at gcc dot gnu.org
  2015-04-22 11:57 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2015-03-27 13:15 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
   Last reconfirmed|                            |2015-03-27
                 CC|                            |manu at gcc dot gnu.org
         Resolution|DUPLICATE                   |---
            Summary|Misleading error message    |Fix column location for
                   |for out-of-class definition |'explicit'
                   |of explicit conversion      |
                   |operator                    |
     Ever confirmed|0                           |1

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> GCC 5 says:
> 
> e.cc:6:42: error: ‘explicit’ outside class declaration
>    explicit ExplicitTest::operator bool() const
>                                           ^
> 
> (The caret position is a well known issue with all error locations, there is
> work being done to improve things.)

I don't think we have a bug open for 'explicit', so this one could be it. It is
probably an EasyHack ideal for a new contributor. Please consider submitting a
patch:
https://gcc.gnu.org/wiki/GettingStarted#Basics:_Contributing_to_GCC_in_10_easy_steps

Small patches don't need any copyright assignment!
>From gcc-bugs-return-482002-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 27 12:58:28 2015
Return-Path: <gcc-bugs-return-482002-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 531 invoked by alias); 27 Mar 2015 12:58:27 -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 450 invoked by uid 55); 27 Mar 2015 12:58:23 -0000
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/65600] [5 Regression] bost testsuite failure: ICE: Segmentation fault
Date: Fri, 27 Mar 2015 13:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ipa
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hubicka at ucw dot cz
X-Bugzilla-Status: UNCONFIRMED
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:
Message-ID: <bug-65600-4-doMRFd2JLg@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65600-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65600-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/msg03146.txt.bz2
Content-length: 1347

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

--- Comment #2 from Jan Hubicka <hubicka at ucw dot cz> ---
Oops, really hope this is last one  of this can of worms :(
The problem here is that resolve_speculation assumes the cgraph node exists. I
am testing the following:

Index: ipa-inline-analysis.c
==================================================================--- ipa-inline-analysis.c    (revision 221725)
+++ ipa-inline-analysis.c    (working copy)
@@ -766,15 +766,15 @@ static struct cgraph_edge *
 redirect_to_unreachable (struct cgraph_edge *e)
 {
   struct cgraph_node *callee = !e->inline_failed ? e->callee : NULL;
+  struct cgraph_node *target = cgraph_node::get_create
+              (builtin_decl_implicit (BUILT_IN_UNREACHABLE));

   if (e->speculative)
-    e = e->resolve_speculation (builtin_decl_implicit (BUILT_IN_UNREACHABLE));
+    e = e->resolve_speculation (target->decl);
   else if (!e->callee)
-    e->make_direct (cgraph_node::get_create
-              (builtin_decl_implicit (BUILT_IN_UNREACHABLE)));
+    e->make_direct (target);
   else
-    e->redirect_callee (cgraph_node::get_create
-            (builtin_decl_implicit (BUILT_IN_UNREACHABLE)));
+    e->redirect_callee (target);
   struct inline_edge_summary *es = inline_edge_summary (e);
   e->inline_failed = CIF_UNREACHABLE;
   e->frequency = 0;


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

* [Bug c++/65598] Fix column location for 'explicit'
  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
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-22 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.0                         |5.2

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 5.1 has been released.


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

* [Bug c++/65598] Fix column location for 'explicit'
  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
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-05-22 11:03 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com
   Target Milestone|5.2                         |6.0

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

* [Bug c++/65598] Fix column location for 'explicit'
  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
                   ` (5 preceding siblings ...)
  2015-05-22 14:15 ` paolo.carlini at oracle dot com
@ 2015-05-22 14:15 ` paolo at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-05-22 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Fri May 22 14:14:38 2015
New Revision: 223576

URL: https://gcc.gnu.org/viewcvs?rev=223576&root=gcc&view=rev
Log:
/cp
2015-05-22  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/65598
        * decl.c (grokdeclarator): Use the correct location in error
        messages about 'explicit'.

/testsuite
2015-05-22  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/65598
        * g++.dg/cpp0x/explicit9.C: New.
        * g++.dg/cpp0x/explicit8.C: Check the locations too.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/explicit9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/explicit8.C


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

* [Bug c++/65598] Fix column location for 'explicit'
  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
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-05-22 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed.


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