4
This catches upcasts like this: Some_Type * const an_identifier =
5
dynamic_cast<Some_Type *>(source) This is unnecessarily verbose and should be
6
abbreviated with the upcast macro: upcast(Some_Type, an_identifier, source)
10
regexp=r"""(^\w*|[^:][^_a-zA-Z0-9]|:[^: ]) *(([_a-zA-Z][_a-zA-Z0-9]* *::)* *[_a-zA-Z][_a-zA-Z0-9]*(( +const)? *\*)*) *(const *)?\* *const +[_a-zA-Z][_a-zA-Z0-9]* *= *dynamic_cast *< *\2 *(const *)?\* *>"""
12
error_msg = "Your upcast is ugly. Use upcast() macro!"
15
'if (B_t const * const hej = dynamic_cast<B_t *>(du)) {',
16
'B_t const*const hej=dynamic_cast < B_t* >(du)) {',
17
'const B_t *const hej=dynamic_cast<B_t*>',
18
'MN:B_t *const hej=dynamic_cast<B_t*>',
19
'MN::B_t *const hej=dynamic_cast<MN::B_t*>',
20
' B_t const * const hej=dynamic_cast<B_t const*>',
21
'B_t const * const hej=dynamic_cast<B_t const*>',
26
'Some_Type ha = dynamic_cast<Some_Type>',
27
'Some_Type ha = dynamic_cast<Some_Typ>',
28
'const B_t * hej = dymamic_cast<B_t *>',
29
'MN::B_t *const hej=dynamic_cast<B_t*>',