This would warn the developer on the very common bug that consists in writing, eg., Factory.add(Set, Item); instead of Set = Factory.add(Set, Item);. Because in the first snippet the updated Set object is discarded while the original object remains unchanged (because it's, well, immutable), which isn't what you ever want to do.
LLVM_NODISCARD is essentially warn_unused_result.
For now no such bugs were found in llvm or clang (in fact, these data structures are mostly used by the clang static analyzer), but i made these mistakes myself knowingly and i see many such bugs during code review.
Adding @chandlerc because he's the code owner for ADT and analyzer folks because it's mostly about the analyzer.