public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67670] New: [c++11] Misleading / outdated error message "invalid pure specifier"
@ 2015-09-21 14:37 arvo at me dot com
0 siblings, 0 replies; only message in thread
From: arvo at me dot com @ 2015-09-21 14:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67670
Bug ID: 67670
Summary: [c++11] Misleading / outdated error message "invalid
pure specifier"
Product: gcc
Version: 5.1.1
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: arvo at me dot com
Target Milestone: ---
Created attachment 36367
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36367&action=edit
Minimal test program (no headers/macros)
g++ (Ubuntu 5.1.1-4ubuntu12) 5.1.1 20150504
x86_64 GNU/Linux
Ubuntu 15.04
Command line: g++ -c -std=c++11 wrong-default.cxx
command output:
wrong-default.cxx:6:17: error: invalid pure specifier (only ‘= 0’ is allowed)
before ‘;’ token
X::X() = defaut;
^
wrong-default.cxx:6:17: error: function ‘X::X()’ is initialized like a variable
I am not suggesting a "Did you mean 'default'?" message, but, in C++11,
obviously the statement "only '= 0' is allowed" is wrong. That is true for the
*pure-specifier*, an optional part of a *member-declarator*, but '= default' or
'= delete' is valid as a *function-body* in a *function-definition*. Curiously,
a *member-declarator* may only occur inside a *class-specifier*, which means
that '= 0' is not even allowed here, even for a virtual method of X (though I
am only looking at draft N3690).
>From gcc-bugs-return-497744-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Sep 21 14:41:46 2015
Return-Path: <gcc-bugs-return-497744-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27591 invoked by alias); 21 Sep 2015 14:41:45 -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 27393 invoked by uid 48); 21 Sep 2015 14:41:42 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/67668] erroneous type argument for unary operator one's complement
Date: Mon, 21 Sep 2015 14:41:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: INVALID
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 cc resolution
Message-ID: <bug-67668-4-adgNX3MlIJ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67668-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67668-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01722.txt.bz2
Content-length: 977
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67668
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |manu at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Marc is right:
The operator ‘~’ performs complex conjugation when used on a value with a
complex type. This is a GNU extension; for values of floating type, you should
use the ISO C99 functions conjf, conj and conjl, declared in <complex.h> and
also provided as built-in functions by GCC.
test.c:3:3: warning: ISO C does not support ‘~’ for complex conjugation
[-Wpedantic]
~( 1. + 0.i ) ;
^
>From gcc-bugs-return-497745-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Sep 21 14:44:41 2015
Return-Path: <gcc-bugs-return-497745-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 47511 invoked by alias); 21 Sep 2015 14:44: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 47475 invoked by uid 48); 21 Sep 2015 14:44:35 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67670] [c++11] Misleading / outdated error message "invalid pure specifier"
Date: Mon, 21 Sep 2015 14:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.1.1
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
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: keywords bug_status cf_reconfirmed_on everconfirmed bug_severity
Message-ID: <bug-67670-4-ptBUVUWnFe@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67670-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67670-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-09/txt/msg01723.txt.bz2
Content-length: 645
https://gcc.gnu.org/bugzilla/show_bug.cgi?idg670
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-09-21
Ever confirmed|0 |1
Severity|trivial |normal
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I thought we already had a PR for this, but I can't find it.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-21 14:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21 14:37 [Bug c++/67670] New: [c++11] Misleading / outdated error message "invalid pure specifier" arvo at me dot com
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).