* iface/gspn/gspn.cc, src/ltlvisit/basicreduce.cc,
src/ltlvisit/destroy.cc, src/ltlvisit/dotty.cc,
src/ltlvisit/dump.cc, src/ltlvisit/length.cc,
src/ltlvisit/nenoform.cc, src/ltlvisit/reduce.cc,
src/ltlvisit/syntimpl.cc, src/ltlvisit/tostring.cc,
src/tgba/formula2bdd.cc, src/tgba/tgbabddconcreteproduct.cc,
src/tgba/tgbatba.cc, src/tgbaalgos/dotty.cc,
src/tgbaalgos/dupexp.cc, src/tgbaalgos/lbtt.cc,
src/tgbaalgos/ltl2tgba_lacim.cc, src/tgbaalgos/neverclaim.cc,
src/tgbaalgos/save.cc, src/tgbaalgos/stats.cc,
src/tgbaalgos/gtec/nsheap.cc, src/tgbaalgos/gtec/nsheap.hh:
Declare private classes and helper function in anonymous namespaces.
* HACKING, src/sanity/style.test: Document and check this.
Also check for trailing { after namespace or class.
* src/ltlast/predecl.hh, src/ltlast/visitor.hh,
src/tgba/tgbareduc.hh: Fix trailing {.
This commit is contained in:
parent
5176caf4d2
commit
7d27fd3796
28 changed files with 3128 additions and 3025 deletions
|
|
@ -72,6 +72,12 @@ for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do
|
|||
grep '[ ]switch (.*).*{' $tmp &&
|
||||
diag 'Opening { should be on its own line.'
|
||||
|
||||
grep 'namespace .*{' $tmp &&
|
||||
diag 'Opening { should be on its own line.'
|
||||
|
||||
grep 'class .*{' $tmp &&
|
||||
diag 'Opening { should be on its own line.'
|
||||
|
||||
grep '( ' $tmp &&
|
||||
diag 'No space after opening (.'
|
||||
|
||||
|
|
@ -137,6 +143,15 @@ for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do
|
|||
diag 'Avoid <iostream> in headers, better use <iosfwd>.'
|
||||
fi
|
||||
;;
|
||||
*.cc)
|
||||
if grep 'namespace$' $tmp >/dev/null; then
|
||||
:
|
||||
else
|
||||
# We only check classes, but the rule should apply to functions too
|
||||
grep '^[ ]*class[ ]' $tmp &&
|
||||
diag 'Private definitions must be in anonymous namespace.'
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue