Skip to content

Commit 1a2fd64

Browse files
Mishura4zajo
andcommitted
Add old clang style to clang-cl type parsing
Co-authored-by: Emil Dotchevski <[email protected]>
1 parent 54b7db1 commit 1a2fd64

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

include/boost/leaf/detail/demangle.hpp

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -147,30 +147,35 @@ namespace n
147147
#define BOOST_LEAF_P(P) (sizeof(char[1 + detail::check_prefix(BOOST_LEAF_PRETTY_FUNCTION, P)]) - 1)
148148
// clang style:
149149
int const p01 = BOOST_LEAF_P("r boost::leaf::n::p() [T = ");
150-
// clang style, msvc abi:
151150
int const p02 = BOOST_LEAF_P("r __cdecl boost::leaf::n::p(void) [T = ");
152151
int const p03 = BOOST_LEAF_P("r __stdcall boost::leaf::n::p(void) [T = ");
153152
int const p04 = BOOST_LEAF_P("r __fastcall boost::leaf::n::p(void) [T = ");
154153
// old clang style:
155154
int const p05 = BOOST_LEAF_P("boost::leaf::n::r boost::leaf::n::p() [T = ");
155+
int const p06 = BOOST_LEAF_P("boost::leaf::n::r __cdecl boost::leaf::n::p(void) [T = ");
156+
int const p07 = BOOST_LEAF_P("boost::leaf::n::r __stdcall boost::leaf::n::p(void) [T = ");
157+
int const p08 = BOOST_LEAF_P("boost::leaf::n::r __fastcall boost::leaf::n::p(void) [T = ");
156158
// gcc style:
157-
int const p06 = BOOST_LEAF_P("boost::leaf::n::r boost::leaf::n::p() [with T = ");
159+
int const p09 = BOOST_LEAF_P("boost::leaf::n::r boost::leaf::n::p() [with T = ");
160+
int const p10 = BOOST_LEAF_P("boost::leaf::n::r __cdecl boost::leaf::n::p() [with T = ");
161+
int const p11 = BOOST_LEAF_P("boost::leaf::n::r __stdcall boost::leaf::n::p() [with T = ");
162+
int const p12 = BOOST_LEAF_P("boost::leaf::n::r __fastcall boost::leaf::n::p() [with T = ");
158163
// msvc style, struct:
159-
int const p07 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<struct ");
160-
int const p08 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<struct ");
161-
int const p09 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<struct ");
164+
int const p13 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<struct ");
165+
int const p14 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<struct ");
166+
int const p15 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<struct ");
162167
// msvc style, class:
163-
int const p10 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<class ");
164-
int const p11 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<class ");
165-
int const p12 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<class ");
168+
int const p16 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<class ");
169+
int const p17 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<class ");
170+
int const p18 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<class ");
166171
// msvc style, enum:
167-
int const p13 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<enum ");
168-
int const p14 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<enum ");
169-
int const p15 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<enum ");
172+
int const p19 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<enum ");
173+
int const p20 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<enum ");
174+
int const p21 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<enum ");
170175
// msvc style, built-in type:
171-
int const p16 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<");
172-
int const p17 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<");
173-
int const p18 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<");
176+
int const p22 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<");
177+
int const p23 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<");
178+
int const p24 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<");
174179
#undef BOOST_LEAF_P
175180

176181
#define BOOST_LEAF_S(S) (sizeof(char[1 + detail::check_suffix(BOOST_LEAF_PRETTY_FUNCTION, S)]) - 1)
@@ -180,25 +185,18 @@ namespace n
180185
int const s02 = BOOST_LEAF_S(">(void)");
181186
#undef BOOST_LEAF_S
182187

183-
184188
char static_assert_unrecognized_pretty_function_format_please_file_github_issue[sizeof(
185189
char[
186-
(s01 && (1 == (!!p01 + !!p02 + !!p03 + !!p04 + !!p05 + !!p06)))
187-
||
188-
(s02 && (1 == (!!p07 + !!p08 + !!p09 + !!p10 + !!p11 + !!p12 + !!p13 + !!p14 + !!p15)))
190+
(s01 && (1 == (!!p01 + !!p02 + !!p03 + !!p04 + !!p05 + !!p06 + !!p07 + !!p08 + !!p09 + !!p10 + !!p11 + !!p12)))
189191
||
190-
(s02 && (1 == (!!p16 + !!p17 + !!p18)))
192+
(s02 && (1 == (!!p13 + !!p14 + !!p15 + !!p16 + !!p17 + !!p18 + !!p19 + !!p20 + !!p21 + !!p22 + !!p23 + !!p24)))
191193
]
192194
) * 2 - 1];
193195
(void) static_assert_unrecognized_pretty_function_format_please_file_github_issue;
194196

195-
if( int const p = sizeof(char[1 + !!s01 * (p01 + p02 + p03 + p04 + p05 + p06)]) - 1 )
197+
if( int const p = sizeof(char[1 + !!s01 * (p01 + p02 + p03 + p04 + p05 + p06 + p07 + p08 + p09 + p10 + p11 + p12)]) - 1 )
196198
return { BOOST_LEAF_PRETTY_FUNCTION + p, s01 - p };
197-
198-
if( int const p = sizeof(char[1 + !!s02 * (p07 + p08 + p09 + p10 + p11 + p12 + p13 + p14 + p15)]) - 1 )
199-
return { BOOST_LEAF_PRETTY_FUNCTION + p, s02 - p };
200-
201-
int const p = sizeof(char[1 + !!s02 * (p16 + p17 + p18)]) - 1; // p is not zero, we've static asserted the hell out of it
199+
int const p = sizeof(char[1 + !!s02 * (p22 + p23 + p24)]) - 1; // p is not zero, we've static asserted the hell out of it
202200
return { BOOST_LEAF_PRETTY_FUNCTION + p, s02 - p };
203201
}
204202
}

0 commit comments

Comments
 (0)