Patchwork C++ PATCH for c++/47488 (ICE on string literal in function template signature)

login
register
mail settings
Submitter Jason Merrill
Date March 8, 2011, 5:27 p.m.
Message ID <4D7666E9.6000206@redhat.com>
Download mbox | patch
Permalink /patch/86027/
State New
Headers show

Comments

Jason Merrill - March 8, 2011, 5:27 p.m.
We don't know how to mangle a STRING_CST yet, but we don't need to 
crash.  There is a recently added mangling in the ABI document, but it 
is inadequate, so I'd like to get that fixed before adding it to G++.

Tested x86_64-pc-linux-gnu, applied to trunk.
commit 2dceb38738c4aedc2e64bf8e8aa4c621b15e61dd
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Mar 8 12:07:09 2011 -0500

    	PR c++/47488
    	* mangle.c (write_template_arg_literal) [STRING_CST]: Sorry.

Patch

diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index c46ba30..f063d47 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2764,6 +2764,10 @@  write_template_arg_literal (const tree value)
       write_real_cst (value);
       break;
 
+    case STRING_CST:
+      sorry ("string literal in function template signature");
+      break;
+
     default:
       gcc_unreachable ();
     }