summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-16 15:03:25 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-16 15:03:25 +0000
commitf4b2c95ec5da39ce94e8827c9b3a106b95b06da9 (patch)
tree501e2cca9fd5d66b53beb9c7347fbf48239a00c1 /gcc
parenta2e48e3caa2ca6871f174f873532128116a49be0 (diff)
downloadppe42-gcc-f4b2c95ec5da39ce94e8827c9b3a106b95b06da9.tar.gz
ppe42-gcc-f4b2c95ec5da39ce94e8827c9b3a106b95b06da9.zip
PR c++/57279
* decl.c (grokdeclarator): Allow member function qualifiers in TYPENAME context. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198975 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-35.C9
3 files changed, 19 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3609fa5e675..72ec0f0dba4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index b16472f6000..a4f686a5767 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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");
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-35.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-35.C
new file mode 100644
index 00000000000..f412b302d06
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-35.C
@@ -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
OpenPOWER on IntegriCloud