mirror of
https://github.com/nasa/trick.git
synced 2025-02-20 09:16:20 +00:00
tool for detecting mismatch between friend init_attr and containing class #371
Added a check and warning message in ICG that warns you if a friend function starts with "init_attr" but does not match the current class name.
This commit is contained in:
parent
aab6ce3c9e
commit
a1bc45548b
@ -310,6 +310,11 @@ bool CXXRecordVisitor::VisitFriendDecl( clang::FriendDecl *fd ) {
|
||||
if ( ! friend_str.find(init_func) ) {
|
||||
//std::cout << " [32mfound a friend![00m" << std::endl ;
|
||||
cval.setHasInitAttrFriend(true) ;
|
||||
} else if ( ! friend_str.find("init_attr") ) {
|
||||
std::cerr << bold(color(WARNING,"Warning")) << " " << cval.getFileName() << ":" <<
|
||||
ci.getSourceManager().getSpellingLineNumber(fd->getSourceRange().getBegin()) << ":" << std::endl ;
|
||||
std::cerr << " friend " << friend_str << " does not match expected name " <<
|
||||
init_func << std::endl ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user