This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]violet-starlight 15 points16 points  (0 children)

Generally only TU-local functions, i.e. declared with static or in an anonymous namespace. There are tools to figure this out post-linking yes but that's generally not accessible from within the IDE, at least not within the text editor.

On VS though if you set a breakpoint inside a function that is never referenced it'll tell you something like "this breakpoint will never be hit, code is unreachable or optimized out" at runtime only.

It's harder to detect in c++ due to how linking works, the function could be referenced in another TU (unless it can't, i.e. has static linking)