]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/51265 (ICE in finish_decltype_type, at cp/semantics.c:5244)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 22 Nov 2011 21:37:24 +0000 (21:37 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 22 Nov 2011 21:37:24 +0000 (21:37 +0000)
/cp
2011-11-22  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51265
* semantics.c (finish_decltype_type): Handle PTRMEM_CST.

/testsuite
2011-11-22  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51265
* g++.dg/cpp0x/decltype36.C: New.

From-SVN: r181641

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/decltype36.C [new file with mode: 0644]

index aee5bec834763df8e31df32d1efac23ec61a6f55..ecacea34c8926f293372086ffb70d18cb9c0bd8c 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-22  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51265
+       * semantics.c (finish_decltype_type): Handle PTRMEM_CST.
+
 2011-11-18  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/51150
index e02bd53af1c66d2972780cec89583e953a7b270b..db2b3db052d402202023bee0eb0d3d9c418c603a 100644 (file)
@@ -4927,8 +4927,9 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p,
           gcc_unreachable ();
 
         case INTEGER_CST:
+       case PTRMEM_CST:
           /* We can get here when the id-expression refers to an
-             enumerator.  */
+             enumerator or non-type template parameter.  */
           type = TREE_TYPE (expr);
           break;
 
index 4e675960df4afd6b81a484b0691e62096f8d2d25..7a5c0d3888f1cc15d84556f1aedd863fda4c7933 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-22  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51265
+       * g++.dg/cpp0x/decltype36.C: New.
+
 2011-11-19  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.dg/delay-slot-2.c: New test.
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype36.C b/gcc/testsuite/g++.dg/cpp0x/decltype36.C
new file mode 100644 (file)
index 0000000..f3dfed9
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/51265
+// { dg-options -std=c++0x }
+
+struct Funny
+{
+  int print(int);
+};
+
+template<typename X>
+void c();
+
+template<typename X, X ff>
+void xx()
+{
+  c<decltype(ff)>();
+}
+
+int main()
+{
+  xx<int(Funny::*)(int), &Funny::print>();
+}