diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-06 21:39:34 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-06 21:39:34 +0000 |
commit | 407e46c7d13e0cbfeab899a1983e720545521e33 (patch) | |
tree | 0cf62a6660665dc55d0209e692377964139cd92b /libiberty | |
parent | fb5491a01b3b59e01592ab64e570683ba6dfad42 (diff) | |
download | gcc-407e46c7d13e0cbfeab899a1983e720545521e33.tar.gz |
* cp-demangle.c (cplus_demangle_type): decltype, pack expansion
and vector are substitutable.
(cplus_demangle_operators): Sort.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182969 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 6 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 10 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 12 |
3 files changed, 25 insertions, 3 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 344f18dc7c4..97ea84fdc42 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2012-01-06 Jason Merrill <jason@redhat.com> + + * cp-demangle.c (cplus_demangle_type): decltype, pack expansion + and vector are substitutable. + (cplus_demangle_operators): Sort. + 2012-01-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * configure: Regenerate. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 0f1166be48c..0ed83976dfa 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -1554,7 +1554,8 @@ d_identifier (struct d_info *di, int len) /* operator_name ::= many different two character encodings. ::= cv <type> ::= v <digit> <source-name> -*/ + + This list is sorted for binary search. */ #define NL(s) s, (sizeof s) - 1 @@ -1566,6 +1567,8 @@ const struct demangle_operator_info cplus_demangle_operators[] = { "aa", NL ("&&"), 2 }, { "ad", NL ("&"), 1 }, { "an", NL ("&"), 2 }, + { "at", NL ("alignof "), 1 }, + { "az", NL ("alignof "), 1 }, { "cl", NL ("()"), 2 }, { "cm", NL (","), 2 }, { "co", NL ("~"), 1 }, @@ -1611,8 +1614,6 @@ const struct demangle_operator_info cplus_demangle_operators[] = { "rs", NL (">>"), 2 }, { "st", NL ("sizeof "), 1 }, { "sz", NL ("sizeof "), 1 }, - { "at", NL ("alignof "), 1 }, - { "az", NL ("alignof "), 1 }, { NULL, NULL, 0, 0 } }; @@ -2242,12 +2243,14 @@ cplus_demangle_type (struct d_info *di) d_expression (di), NULL); if (ret && d_next_char (di) != 'E') ret = NULL; + can_subst = 1; break; case 'p': /* Pack expansion. */ ret = d_make_comp (di, DEMANGLE_COMPONENT_PACK_EXPANSION, cplus_demangle_type (di), NULL); + can_subst = 1; break; case 'f': @@ -2298,6 +2301,7 @@ cplus_demangle_type (struct d_info *di) case 'v': ret = d_vector_type (di); + can_subst = 1; break; case 'n': diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 70abf681ae8..642fe1427ed 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -4018,6 +4018,18 @@ K<1, &S::m>::f() --format=gnu-v3 _ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_ _ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_ +# A pack expansion is substitutable. +--format=gnu-v3 +_Z1fIJiEiEv1AIJDpT_EET0_S4_ +void f<int, int>(A<int>, int, int) +# So is decltype. +--format=gnu-v3 +_Z1fIiiEDTcvT__EET0_S2_ +decltype ((int)()) f<int, int>(int, int) +# And vector. +--format=gnu-v3 +_Z1fDv4_iS_ +f(int __vector(4), int __vector(4)) # # Ada (GNAT) tests. # |