Skip to content

Commit 54b7db1

Browse files
committed
Added parsing for clang-cl of BOOST_LEAF_PRETTY_FUNCTION
1 parent 6633c36 commit 54b7db1

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

include/boost/leaf/detail/demangle.hpp

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -147,26 +147,30 @@ 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:
151+
int const p02 = BOOST_LEAF_P("r __cdecl boost::leaf::n::p(void) [T = ");
152+
int const p03 = BOOST_LEAF_P("r __stdcall boost::leaf::n::p(void) [T = ");
153+
int const p04 = BOOST_LEAF_P("r __fastcall boost::leaf::n::p(void) [T = ");
150154
// old clang style:
151-
int const p02 = BOOST_LEAF_P("boost::leaf::n::r boost::leaf::n::p() [T = ");
155+
int const p05 = BOOST_LEAF_P("boost::leaf::n::r boost::leaf::n::p() [T = ");
152156
// gcc style:
153-
int const p03 = BOOST_LEAF_P("boost::leaf::n::r boost::leaf::n::p() [with T = ");
157+
int const p06 = BOOST_LEAF_P("boost::leaf::n::r boost::leaf::n::p() [with T = ");
154158
// msvc style, struct:
155-
int const p04 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<struct ");
156-
int const p05 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<struct ");
157-
int const p06 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<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 ");
158162
// msvc style, class:
159-
int const p07 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<class ");
160-
int const p08 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<class ");
161-
int const p09 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<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 ");
162166
// msvc style, enum:
163-
int const p10 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<enum ");
164-
int const p11 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<enum ");
165-
int const p12 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<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 ");
166170
// msvc style, built-in type:
167-
int const p13 = BOOST_LEAF_P("struct boost::leaf::n::r __cdecl boost::leaf::n::p<");
168-
int const p14 = BOOST_LEAF_P("struct boost::leaf::n::r __stdcall boost::leaf::n::p<");
169-
int const p15 = BOOST_LEAF_P("struct boost::leaf::n::r __fastcall boost::leaf::n::p<");
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<");
170174
#undef BOOST_LEAF_P
171175

172176
#define BOOST_LEAF_S(S) (sizeof(char[1 + detail::check_suffix(BOOST_LEAF_PRETTY_FUNCTION, S)]) - 1)
@@ -176,24 +180,25 @@ namespace n
176180
int const s02 = BOOST_LEAF_S(">(void)");
177181
#undef BOOST_LEAF_S
178182

183+
179184
char static_assert_unrecognized_pretty_function_format_please_file_github_issue[sizeof(
180185
char[
181-
(s01 && (1 == (!!p01 + !!p02 + !!p03)))
186+
(s01 && (1 == (!!p01 + !!p02 + !!p03 + !!p04 + !!p05 + !!p06)))
182187
||
183-
(s02 && (1 == (!!p04 + !!p05 + !!p06 + !!p07 + !!p08 + !!p09 + !!p10 + !!p11 + !!p12)))
188+
(s02 && (1 == (!!p07 + !!p08 + !!p09 + !!p10 + !!p11 + !!p12 + !!p13 + !!p14 + !!p15)))
184189
||
185-
(s02 && (1 == (!!p13 + !!p14 + !!p15)))
190+
(s02 && (1 == (!!p16 + !!p17 + !!p18)))
186191
]
187192
) * 2 - 1];
188193
(void) static_assert_unrecognized_pretty_function_format_please_file_github_issue;
189194

190-
if( int const p = sizeof(char[1 + !!s01 * (p01 + p02 + p03)]) - 1 )
195+
if( int const p = sizeof(char[1 + !!s01 * (p01 + p02 + p03 + p04 + p05 + p06)]) - 1 )
191196
return { BOOST_LEAF_PRETTY_FUNCTION + p, s01 - p };
192197

193-
if( int const p = sizeof(char[1 + !!s02 * (p04 + p05 + p06 + p07 + p08 + p09 + p10 + p11 + p12)]) - 1 )
198+
if( int const p = sizeof(char[1 + !!s02 * (p07 + p08 + p09 + p10 + p11 + p12 + p13 + p14 + p15)]) - 1 )
194199
return { BOOST_LEAF_PRETTY_FUNCTION + p, s02 - p };
195200

196-
int const p = sizeof(char[1 + !!s02 * (p13 + p14 + p15)]) - 1; // p is not zero, we've static asserted the hell out of it
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
197202
return { BOOST_LEAF_PRETTY_FUNCTION + p, s02 - p };
198203
}
199204
}

0 commit comments

Comments
 (0)