public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60265] New: [C++11] using-declarator of enumerator fails if fully qualified
@ 2014-02-18 18:14 roger.ferrer at bsc dot es
2014-06-11 17:28 ` [Bug c++/60265] [C++11] using-declaration " paolo at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: roger.ferrer at bsc dot es @ 2014-02-18 18:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60265
Bug ID: 60265
Summary: [C++11] using-declarator of enumerator fails if fully
qualified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: roger.ferrer at bsc dot es
Hi,
a using-declarator the nested-name of which includes an enumerator-name fails,
as g++ seems to expect only namespace-names at this point.
This seems a specific lookup problem of the using-declarator. Other
qualified-ids, seem to work, as shown in the snippet below.
// -- enum.cc
namespace A
{
enum E { V };
}
namespace B
{
void f1()
{
int x;
x = A::E::V; // OK
x = A::V; // OK
}
void f2()
{
using A::V; // OK
int x;
x = V;
}
void f3()
{
using A::E::V; // ERR (but should be OK)
int x;
x = V;
}
}
// -- end of enum.cc
$ ~/soft/gcc-experiment/gcc-install/bin/g++ -std=c++11 --version
g++ (GCC) 4.9.0 20140218 (experimental)
$ g++ -std=c++11 -c enum.cc
enum.cc: In function ‘void B::f3()’:
enum.cc:24:21: error: ‘A::E’ is not a namespace
using A::E::V; // ERR
^
enum.cc:26:13: error: ‘V’ was not declared in this scope
x = V;
^
enum.cc:26:13: note: suggested alternative:
enum.cc:3:14: note: ‘V’
enum E { V };
Kind regards,
>From gcc-bugs-return-444116-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Feb 18 18:21:30 2014
Return-Path: <gcc-bugs-return-444116-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9169 invoked by alias); 18 Feb 2014 18:21:29 -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 9139 invoked by uid 48); 18 Feb 2014 18:21:26 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60265] [C++11] using-declarator of enumerator fails if fully qualified
Date: Tue, 18 Feb 2014 18:21: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: unknown
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
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: keywords bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-60265-4-cia2hd7i3t@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60265-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60265-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: 2014-02/txt/msg01873.txt.bz2
Content-length: 463
http://gcc.gnu.org/bugzilla/show_bug.cgi?id`265
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-02-18
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/60265] [C++11] using-declaration of enumerator fails if fully qualified
2014-02-18 18:14 [Bug c++/60265] New: [C++11] using-declarator of enumerator fails if fully qualified roger.ferrer at bsc dot es
@ 2014-06-11 17:28 ` paolo at gcc dot gnu.org
2014-06-11 17:30 ` paolo.carlini at oracle dot com
2014-06-20 18:34 ` ppluzhnikov at google dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-06-11 17:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60265
--- Comment #1 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Wed Jun 11 17:28:14 2014
New Revision: 211479
URL: http://gcc.gnu.org/viewcvs?rev=211479&root=gcc&view=rev
Log:
/cp
2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60265
* parser.c (cp_parser_using_declaration): Handle unscoped enums.
* name-lookup.c (validate_nonmember_using_decl): Adjust error
message.
/testsuite
2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60265
* g++.dg/cpp0x/using-enum-1.C: New.
* g++.dg/cpp0x/using-enum-2.C: Likewise.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/using-enum-1.C
trunk/gcc/testsuite/g++.dg/cpp0x/using-enum-2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/name-lookup.c
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/60265] [C++11] using-declaration of enumerator fails if fully qualified
2014-02-18 18:14 [Bug c++/60265] New: [C++11] using-declarator of enumerator fails if fully qualified roger.ferrer at bsc dot es
2014-06-11 17:28 ` [Bug c++/60265] [C++11] using-declaration " paolo at gcc dot gnu.org
@ 2014-06-11 17:30 ` paolo.carlini at oracle dot com
2014-06-20 18:34 ` ppluzhnikov at google dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-11 17:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60265
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |4.10.0
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.10.0.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/60265] [C++11] using-declaration of enumerator fails if fully qualified
2014-02-18 18:14 [Bug c++/60265] New: [C++11] using-declarator of enumerator fails if fully qualified roger.ferrer at bsc dot es
2014-06-11 17:28 ` [Bug c++/60265] [C++11] using-declaration " paolo at gcc dot gnu.org
2014-06-11 17:30 ` paolo.carlini at oracle dot com
@ 2014-06-20 18:34 ` ppluzhnikov at google dot com
2 siblings, 0 replies; 4+ messages in thread
From: ppluzhnikov at google dot com @ 2014-06-20 18:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60265
Paul Pluzhnikov <ppluzhnikov at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppluzhnikov at google dot com
--- Comment #3 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
Can this be backported to 4_9-branch?
Google ref: b/15617537
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-20 18:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-18 18:14 [Bug c++/60265] New: [C++11] using-declarator of enumerator fails if fully qualified roger.ferrer at bsc dot es
2014-06-11 17:28 ` [Bug c++/60265] [C++11] using-declaration " paolo at gcc dot gnu.org
2014-06-11 17:30 ` paolo.carlini at oracle dot com
2014-06-20 18:34 ` ppluzhnikov at google 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).