Bug 51319 - [4.7 Regression] Eigen3 enums not accepted
Summary: [4.7 Regression] Eigen3 enums not accepted
Status: RESOLVED DUPLICATE of bug 51382
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-11-26 21:28 UTC by Marc Glisse
Modified: 2011-12-05 22:04 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-11-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Glisse 2011-11-26 21:28:34 UTC
This is likely related to Bug 51312 and/or Bug 51305, but let me report it just to be sure:

template<int> struct X{};
struct Base {
        enum { a=1 };
};
struct Der : Base {
        using Base::a;
        typedef X<(int)a> Y;
};

$ g++ u.cc -c          
u.cc:7:26: error: 'using Base::a' cannot appear in a constant-expression
u.cc:7:27: error: template argument 1 is invalid

$ g++ -std=c++0x u.cc -c
u.cc:7:26: error: invalid cast from type 'Base' to type 'int'
u.cc:7:27: error: template argument 1 is invalid
Comment 1 Volker Reichelt 2011-11-29 22:18:38 UTC
Confirmed.
Comment 2 fabien 2011-12-04 22:07:45 UTC
(In reply to comment #0)
> This is likely related to Bug 51312 and/or Bug 51305

Most likely Bug 51382 ;-)

*** This bug has been marked as a duplicate of bug 51382 ***
Comment 3 fabien 2011-12-05 22:04:45 UTC
Author: fabien
Date: Mon Dec  5 22:04:40 2011
New Revision: 182029

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182029
Log:
gcc/testsuite/ChangeLog

2011-12-05  Fabien Chene  <fabien@gcc.gnu.org>

	PR c++/51319
	* g++.dg/lookup/using50.C: New.
	* g++.dg/lookup/using51.C: New.

gcc/cp/ChangeLog

2011-12-05  Fabien Chene  <fabien@gcc.gnu.org>

	PR c++/51319
	* semantics.c (finish_id_expression): Strip using declarations
	early in the function.

Added:
    trunk/gcc/testsuite/g++.dg/lookup/using50.C
    trunk/gcc/testsuite/g++.dg/lookup/using51.C
Modified:
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog