GCC 2.95.3 name mangling grammar (intuited from gcc sources): ------------------------------------------------------------ ::= '__F' ::= '__' ::= '__' ::= '_' '_' ::= '.' | '$' # system-dependent joiner ::= ::= ::= 'Q' + ::= 'Q' '_' + '_' + ::= + # length-prefixed name ::= 'R' # reference ::= 'P' # array or pointer type ::= 'O' '_' # offset type ::= 'M' # methods ::= ::= ::= ::= ::= 'F' '_' ::= 'e' # () parameters ::= 'v' # (void) parameters ::= + ::= + 'e' # ends in "..." ::= ::= [C] [U] [V] [u] # const, unsigned, volatile, restrict ::= 'i' # int ::= 'l' # long ::= 's' # short ::= 'Sc' # signed char ::= 'c' # char ::= 'w' # wchar/java-char ::= 'x' # long long ::= 'b' # bool ::= 'r' # long double ::= 'd' # double ::= 'f' # float ::= 'J' # complex ::= 'v' # void ::= 'I' # integer of bits ::= # sizes < 256 ::= _ + _ # sizes >= 256 ::= ::= ::= 'T' # single repeat ::= 'N' # repeats of 2..9 ::= 'N' '_' # repeats of 10 or more ::= 'n' # alt-style, repeats of 1..9 ::= 'n' '_' # alt-style, repeats of 10+ ::= # backrefs 0..9 ::= '_' # backrefs of 10 or more GCC 3.2 name mangling grammar (extracted from gcc sources): ---------------------------------------------------------- ::= St # ::std ::= Sa # ::std::allocator ::= Sb # ::std::basic_string ::= Ss # ::std::basic_string, ::std::allocator > ::= Si # ::std::basic_istream > ::= So # ::std::basic_ostream > ::= Sd # ::std::basic_iostream > ::= S _ # base 36 sequence id ::= S_ ::= _Z ::= ::= ::= ::= ::= ::= If IGNORE_LOCAL_SCOPE option to is non-zero, this production of is called from , which mangles the enclosing scope elsewhere and then uses this function to mangle just the part underneath the function scope. So don't use the production, to avoid an infinite recursion. ::= ::= St # ::std:: ::= ::= ::= N [] E ::= N [] E ::= [r] [V] [K] ::= > ::= ::= # empty ::= ::=