always capture exceptions by const references

For #199.

* tests/sanity/style.test: Test this.
* bin/ltlcross.cc, spot/parseaut/parseaut.yy,
tests/ltsmin/modelcheck.cc: Fix it.
This commit is contained in:
Alexandre Duret-Lutz 2018-03-14 17:51:08 +01:00
parent 2a308182db
commit 2d18ac22fb
4 changed files with 10 additions and 6 deletions

View file

@ -287,6 +287,10 @@ for dir in "$TOP/spot" "$TOP/bin" "$TOP/tests"; do
diag 'No "if (x)" required before "delete x;".'
fi
# we want catch (const reftype&) or catch (...)
$GREP 'catch *([^.]' $tmp | $GREP -v 'const.*\&' &&
diag 'Always capture exceptions by const reference.'
case $file in
*.hh | *.hxx)
if e$GREP '(<<|>>)' $tmp >/dev/null; then