@@ -400,8 +400,11 @@ namespace attributes {
400
400
Param sigParam = paramNamed (kExportSignature );
401
401
std::string sig = sigParam.value ();
402
402
trimWhitespace (&sig);
403
+ if (sig.empty ()) return sig;
403
404
if (sig.back () == ' }' )
404
405
sig = sig.substr (0 , sig.size ()-1 );
406
+ // check sig.empty again since we deleted an element
407
+ if (sig.empty ()) return sig;
405
408
if (sig.front () == ' {' )
406
409
sig.erase (0 ,1 );
407
410
return sig;
@@ -1444,8 +1447,8 @@ namespace attributes {
1444
1447
const std::string delimiters (" ," );
1445
1448
std::vector<Param> params;
1446
1449
std::string::size_type current;
1447
- std::string::size_type next = - 1 ;
1448
- std::string::size_type signature_param_start = - 1 ;
1450
+ std::string::size_type next = std::string::npos ;
1451
+ std::string::size_type signature_param_start = std::string::npos ;
1449
1452
do { // #nocov
1450
1453
next = input.find_first_not_of (delimiters, next + 1 );
1451
1454
if (next == std::string::npos)
@@ -1463,7 +1466,7 @@ namespace attributes {
1463
1466
1464
1467
// if the signature param was found, then check that the name,
1465
1468
// start block and end block exist and are in the correct order
1466
- if (signature_param_start != static_cast < std::string::size_type>(- 1 ) ) {
1469
+ if (signature_param_start != std::string::npos ) {
1467
1470
bool sigchecks =
1468
1471
signature_param_start < blockstart &&
1469
1472
blockstart < blockend &&
0 commit comments