]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Jun 2014 14:47:42 +0000 (14:47 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Jun 2014 14:47:42 +0000 (14:47 +0000)
2014-06-24  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/33972
* decl.c (grokdeclarator): Do not early check for operator-function-id
as non-function.

/testsuite
2014-06-24  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/33972
* g++.dg/other/operator3.C: New.
* g++.dg/template/operator8.C: Adjust.
* g++.dg/template/operator9.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211944 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/operator3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/operator8.C
gcc/testsuite/g++.dg/template/operator9.C

index f2f4e3cb5f097e931819c9fc6a3514f0ed9cd840..f9f0eabf1d206cde73a74a1fdd0c43d7a839f02a 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/33972
+       * decl.c (grokdeclarator): Do not early check for operator-function-id
+       as non-function.
+
 2014-06-24  Trevor Saunders  <tsaunders@mozilla.com>
 
        * class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
index b4d8b94feb1c918687805027e01d98020110d37f..d548f61fa51879008664ad22070f9da50bfa72b6 100644 (file)
@@ -9007,7 +9007,7 @@ grokdeclarator (const cp_declarator *declarator,
       return error_mark_node;
     }
 
-  if (((dname && IDENTIFIER_OPNAME_P (dname)) || flags == TYPENAME_FLAG)
+  if (flags == TYPENAME_FLAG
       && innermost_code != cdk_function
       && ! (ctype && !declspecs->any_specifiers_p))
     {
index ade10c74a3c7a5fe85121f93c64c79c9a2025bf4..d42af0ffaa7466dd149a2ca40d43807eaf6f9e98 100644 (file)
@@ -1,3 +1,10 @@
+2014-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/33972
+       * g++.dg/other/operator3.C: New.
+       * g++.dg/template/operator8.C: Adjust.
+       * g++.dg/template/operator9.C: Likewise.
+
 2014-06-24  Alan Lawrence  <alan.lawrence@arm.com>
 
        * gcc.target/aarch64/singleton_intrinsics_1.c: Save temps and cleanup.
diff --git a/gcc/testsuite/g++.dg/other/operator3.C b/gcc/testsuite/g++.dg/other/operator3.C
new file mode 100644 (file)
index 0000000..5c0968d
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/33972
+
+struct s
+{
+  typedef void f(void);
+  f operator();
+};
index 29d17b84b89b897c577e2570f97b1508a66255bf..52f22188ddbcbc01dd4aeac0ad41c35d7faaeaaf 100644 (file)
@@ -2,5 +2,5 @@
 
 struct A
 {
-    template<operator+> void foo() {}   // { dg-error "identifier|non-function|template arguments" }
+    template<operator+> void foo() {}   // { dg-error "identifier|parameter|template arguments" }
 };
index dfd491d4f04be697e560f20443b3b1f48b76325e..d4ebad3aa13256f7500292e7704ab3047cd64cd3 100644 (file)
@@ -1,6 +1,6 @@
 //PR c++/27670
 
-template<operator+> void foo(); // { dg-error "before|non-function|template" }
+template<operator+> void foo(); // { dg-error "before|parameter|template" }
 
 void bar()
 {