re PR c++/57279 ([C++11] alias declaration fails to declare function types with cv-qualifiers)
PR c++/57279 * decl.c (grokdeclarator): Allow member function qualifiers in TYPENAME context. From-SVN: r198975
This commit is contained in:
parent
f999cd107a
commit
11678eb383
@ -1,3 +1,9 @@
|
||||
2013-05-16 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/57279
|
||||
* decl.c (grokdeclarator): Allow member function qualifiers in
|
||||
TYPENAME context in C++11 mode.
|
||||
|
||||
2013-05-16 Dodji Seketeli <dodji@redhat.com>
|
||||
|
||||
PR c++/56782 - Regression with empty pack expansions
|
||||
|
@ -10295,8 +10295,10 @@ grokdeclarator (const cp_declarator *declarator,
|
||||
|
||||
if (ctype)
|
||||
type = build_memfn_type (type, ctype, memfn_quals, rqual);
|
||||
/* Core issue #547: need to allow this in template type args. */
|
||||
else if (template_type_arg && TREE_CODE (type) == FUNCTION_TYPE)
|
||||
/* Core issue #547: need to allow this in template type args.
|
||||
Allow it in general in C++11 for alias-declarations. */
|
||||
else if ((template_type_arg || cxx_dialect >= cxx11)
|
||||
&& TREE_CODE (type) == FUNCTION_TYPE)
|
||||
type = apply_memfn_quals (type, memfn_quals, rqual);
|
||||
else
|
||||
error ("invalid qualifiers on non-member function type");
|
||||
|
9
gcc/testsuite/g++.dg/cpp0x/alias-decl-35.C
Normal file
9
gcc/testsuite/g++.dg/cpp0x/alias-decl-35.C
Normal file
@ -0,0 +1,9 @@
|
||||
// PR c++/57279
|
||||
// { dg-require-effective-target c++11 }
|
||||
|
||||
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
|
Loading…
Reference in New Issue
Block a user