public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57734] New: Returning template alias to enum class fails with "invalid declarator"
@ 2013-06-27 14:31 rschumacher at tamu dot edu
  2013-08-01 10:21 ` [Bug c++/57734] " paolo.carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rschumacher at tamu dot edu @ 2013-06-27 14:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57734

            Bug ID: 57734
           Summary: Returning template alias to enum class fails with
                    "invalid declarator"
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rschumacher at tamu dot edu

Created attachment 30390
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30390&action=edit
Test file exhibiting the bug (test.ii).

When attempting to return a template alias to an enum class, g++ emits the
error "invalid declarator before 'foo'".

Code:

enum class eclass { zero };

template<typename a>
using eclass_alias = eclass;

template<typename T0>
eclass_alias<T0> foo(T0 f) { return eclass_alias<T0>::zero; }

int main() {}

Command Line:

g++-4.9 -v -save-temps -std=c++11 test.cpp

Compiler Output:

test.cpp:7:18: error: invalid declarator before ‘foo’
 eclass_alias<T0> foo(T0 f) { return eclass_alias<T0>::zero; }
                  ^

Compiler Specs:

Using built-in specs.
COLLECT_GCC=g++-4.9
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/ras0219/abs/gcc-git/src/gcc/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share/gcc-4.9
--with-bugurl='http://aur.archlinux.org/packages.php?ID=16045'
--enable-languages=c,c++,lto --enable-shared --enable-threads=posix
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-clocale=gnu --disable-libstdcxx-pch --enable-gnu-unique-object
--enable-linker-build-id --enable-cloog-backend=isl
--disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default
--enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu
--disable-install-libiberty --disable-multilib --disable-libssp
--disable-werror --enable-checking=release --program-suffix=-4.9
--enable-version-specific-runtime-libs : (reconfigured)
/home/ras0219/abs/gcc-git/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--datadir=/usr/share/gcc-4.9
--with-bugurl='http://aur.archlinux.org/packages.php?ID=16045'
--enable-languages=c,c++,lto --enable-shared --enable-threads=posix
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-clocale=gnu --disable-libstdcxx-pch --enable-gnu-unique-object
--enable-linker-build-id --enable-cloog-backend=isl
--disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default
--enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu
--disable-install-libiberty --disable-multilib --disable-libssp
--disable-werror --enable-checking=release --program-suffix=-4.9
--enable-version-specific-runtime-libs
Thread model: posix
gcc version 4.9.0 20130627 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1plus -E -quiet -v -D_GNU_SOURCE
test.cpp -mtune=generic -march=x86-64 -std=c++11 -fpch-preprocess -o test.ii
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/c++

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/c++/x86_64-unknown-linux-gnu
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/c++/backward
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include
 /usr/local/include
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1plus -fpreprocessed test.ii
-quiet -dumpbase test.cpp -mtune=generic -march=x86-64 -auxbase test -std=c++11
-version -o test.s
GNU C++ (GCC) version 4.9.0 20130627 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.9.0 20130627 (experimental), GMP version
5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.9.0 20130627 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.9.0 20130627 (experimental), GMP version
5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 527d08db754c44431edf3997957f9281

System Info:

Linux phylactery 3.9.6-1-ARCH #1 SMP PREEMPT Fri Jun 14 08:12:55 CEST 2013
x86_64 GNU/Linux
>From gcc-bugs-return-425303-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jun 27 14:50:46 2013
Return-Path: <gcc-bugs-return-425303-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6665 invoked by alias); 27 Jun 2013 14:50:46 -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 6255 invoked by uid 48); 27 Jun 2013 14:50:41 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57734] Returning template alias to enum class fails with "invalid declarator"
Date: Thu, 27 Jun 2013 14:50: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.9.0
X-Bugzilla-Keywords:
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: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-57734-4-6bqarcC3EJ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57734-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57734-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: 2013-06/txt/msg01682.txt.bz2
Content-length: 400

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW734

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-27
     Ever confirmed|0                           |1


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

* [Bug c++/57734] Returning template alias to enum class fails with "invalid declarator"
  2013-06-27 14:31 [Bug c++/57734] New: Returning template alias to enum class fails with "invalid declarator" rschumacher at tamu dot edu
@ 2013-08-01 10:21 ` paolo.carlini at oracle dot com
  2013-11-11 20:11 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-08-01 10:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57734

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This isn't just about returning, eg:

typedef eclass_alias<void> test;


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

* [Bug c++/57734] Returning template alias to enum class fails with "invalid declarator"
  2013-06-27 14:31 [Bug c++/57734] New: Returning template alias to enum class fails with "invalid declarator" rschumacher at tamu dot edu
  2013-08-01 10:21 ` [Bug c++/57734] " paolo.carlini at oracle dot com
@ 2013-11-11 20:11 ` paolo.carlini at oracle dot com
  2013-11-12  9:21 ` paolo at gcc dot gnu.org
  2013-11-12  9:24 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-11 20:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57734

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|---                         |4.9.0

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


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

* [Bug c++/57734] Returning template alias to enum class fails with "invalid declarator"
  2013-06-27 14:31 [Bug c++/57734] New: Returning template alias to enum class fails with "invalid declarator" rschumacher at tamu dot edu
  2013-08-01 10:21 ` [Bug c++/57734] " paolo.carlini at oracle dot com
  2013-11-11 20:11 ` paolo.carlini at oracle dot com
@ 2013-11-12  9:21 ` paolo at gcc dot gnu.org
  2013-11-12  9:24 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2013-11-12  9:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57734

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Tue Nov 12 09:21:45 2013
New Revision: 204697

URL: http://gcc.gnu.org/viewcvs?rev=204697&root=gcc&view=rev
Log:
/cp
2013-11-12  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/57734
    * pt.c (lookup_template_class_1): Handle alias template declarations
    of enumeration types.

/testsuite
2013-11-12  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/57734
    * g++.dg/cpp0x/alias-decl-enum-1.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-enum-1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/57734] Returning template alias to enum class fails with "invalid declarator"
  2013-06-27 14:31 [Bug c++/57734] New: Returning template alias to enum class fails with "invalid declarator" rschumacher at tamu dot edu
                   ` (2 preceding siblings ...)
  2013-11-12  9:21 ` paolo at gcc dot gnu.org
@ 2013-11-12  9:24 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-12  9:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57734

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

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


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

end of thread, other threads:[~2013-11-12  9:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-27 14:31 [Bug c++/57734] New: Returning template alias to enum class fails with "invalid declarator" rschumacher at tamu dot edu
2013-08-01 10:21 ` [Bug c++/57734] " paolo.carlini at oracle dot com
2013-11-11 20:11 ` paolo.carlini at oracle dot com
2013-11-12  9:21 ` paolo at gcc dot gnu.org
2013-11-12  9:24 ` paolo.carlini at oracle 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).