summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-func-not-needed.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Consider hidden decls for isUsed checks.Rafael Espindola2013-10-221-0/+9
| | | | | | | | | | | | | | | | | This fixes pr17624. A FIXME from Richard Smith: It seems to me that the root cause is that a per-Decl 'used' flag doesn't really make much sense in the way we use it now. I think we should either track whether that particular declaration is used (with isUsed scanning the entire redecl chain), or we should only have one flag for the entire redeclaration chain (perhaps by always looking at the flag on either the most recent decl or the canonical decl). Modeling it as "is this declaration or any previous declaration used" is weird, and requires contortions like the loop at the end of Sema::MarkFunctionReferenced. llvm-svn: 193202
* Mark all subsequent decls used.Rafael Espindola2013-01-081-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | In the source static void f(); static void f(); template<typename T> static void g() { f(); } static void f() { } void h() { g<int>(); } the call to f refers to the second decl, but it is only marked used at the end of the translation unit during instantiation, after the third f decl has been linked in. With this patch we mark all subsequent decls used, so that it is easy to check if a symbol is used or not. llvm-svn: 171888
* Fix a regression from the previous commit.Rafael Espindola2012-12-261-0/+13
| | | | | | | Template instantiation can set the canonical decl to used after subsequent decls have been chained, so we have to check that too. llvm-svn: 171088
* Use the most recent redecl to decide if it is needed.Rafael Espindola2012-12-261-0/+17
This fixes pr14691, which I think is a regression from r168519. llvm-svn: 171077
OpenPOWER on IntegriCloud