aaron.ballman added a comment. In clang 3.8, your test code already produces a diagnostic for me: http://coliru.stacked-crooked.com/a/752a4ea34123bdae Repository: rL LLVM https://reviews.llvm.org/D24669