summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 21:02:07 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 21:02:07 +0000
commitc5a7bf9e4210918a6d64282bd3f9b58c5b92ee1c (patch)
treee2466ac7db646acfd78689bc5c745b698c31ba6f /libiberty
parent2f205e67b9176574e4290cc917c0416a9eae76f4 (diff)
downloadgcc-c5a7bf9e4210918a6d64282bd3f9b58c5b92ee1c.tar.gz
PR c++/49932
gcc/cp/ * mangle.c (write_prefix): Handle decltype. libiberty/ * cp-demangle.c (d_prefix): Handle decltype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/cp-demangle.c14
-rw-r--r--libiberty/testsuite/demangle-expected4
3 files changed, 22 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 2c5b761020c..b88399e9e36 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/49932
+ * cp-demangle.c (d_prefix): Handle decltype.
+ * testsuite/demangle-expected: Test it.
+
2011-07-26 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/demangle-expected: Remove an extra line.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index f41856be6d0..d67a9e74e65 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1280,6 +1280,7 @@ d_nested_name (struct d_info *di)
/* <prefix> ::= <prefix> <unqualified-name>
::= <template-prefix> <template-args>
::= <template-param>
+ ::= <decltype>
::=
::= <substitution>
@@ -1308,10 +1309,19 @@ d_prefix (struct d_info *di)
<template-param> here. */
comb_type = DEMANGLE_COMPONENT_QUAL_NAME;
- if (IS_DIGIT (peek)
+ if (peek == 'D')
+ {
+ char peek2 = d_peek_next_char (di);
+ if (peek2 == 'T' || peek2 == 't')
+ /* Decltype. */
+ dc = cplus_demangle_type (di);
+ else
+ /* Destructor name. */
+ dc = d_unqualified_name (di);
+ }
+ else if (IS_DIGIT (peek)
|| IS_LOWER (peek)
|| peek == 'C'
- || peek == 'D'
|| peek == 'U'
|| peek == 'L')
dc = d_unqualified_name (di);
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index f9e84473c0b..3737cfd7bdb 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3901,6 +3901,10 @@ java resource java/util/iso4217.properties
--format=gnu-v3
_Z3addIidEDTplfp_fp0_ET_T0_
decltype ({parm#1}+{parm#2}) add<int, double>(int, double)
+# decltype scope test
+--format=gnu-v3
+_Z1fI1SENDtfp_E4typeET_
+decltype ({parm#1})::type f<S>(S)
# decltype/fn call test
--format=gnu-v3
_Z4add3IidEDTclL_Z1gEfp_fp0_EET_T0_