mirror of
https://github.com/nasa/trick.git
synced 2025-03-25 13:27:37 +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
132892012a
commit
0819717183
@ -278,6 +278,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 << "\033[33mWarning\033[0m " << 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