Bug 57279 - [C++11] alias declaration fails to declare function types with cv-qualifiers
Summary: [C++11] alias declaration fails to declare function types with cv-qualifiers
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.8.1
Assignee: Jason Merrill
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2013-05-14 18:37 UTC by Daniel Krügler
Modified: 2013-06-27 10:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-05-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Krügler 2013-05-14 18:37:48 UTC
The following code is rejected if compiled with gcc 4.9.0 20130505 (experimental) using the flags

-std=c++11 -Wall -pedantic-errors

//------------------------------------
typedef void fc1() const; // OK
typedef void frr1() &&; // OK
typedef void fcr1() const &;
using fc2 = void() const; // #4
using frr2 = void() &&; // OK
using fcr2 = void() const &; // #6
//------------------------------------

"main.cpp|4|error: invalid qualifiers on non-member function type|
 main.cpp|6|error: invalid qualifiers on non-member function type|"

According to 8.3.5 [dcl.fct] p6 function type declarations with cv-qualifiers are valid via alias-declarations (b3).
Comment 1 Jason Merrill 2013-05-16 20:10:36 UTC
Fixed.
Comment 2 Jakub Jelinek 2013-05-31 10:58:19 UTC
GCC 4.8.1 has been released.
Comment 3 Matthias Klose 2013-06-27 10:38:50 UTC
closing. this apparently did get into the 4.8.1 release. however can't change the milestone back to 4.8.1.
Comment 4 Jonathan Wakely 2013-06-27 10:46:51 UTC
Trunk: http://gcc.gnu.org/r198975
4.8.1: http://gcc.gnu.org/r198976