[llvm-bugs] [Bug 24404] New: Missing result unused after macro expansion
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Aug 8 18:03:47 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=24404
Bug ID: 24404
Summary: Missing result unused after macro expansion
Product: clang
Version: unspecified
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: adkap at adkap.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
This follows from a bug in a popular Obj-C testing framework Expecta:
https://github.com/specta/expecta/issues/160
Basically, a macro evaluates to an Objective-C object pointer, is sent a
message, and the result is unused. There is no warning produced. However if the
macro is enclosed in parens/(), the warning is produced as expected.
This isn't an academic case: I had several tests "pass" because the trailing
parentheses were accidentally omitted.
A very short example
https://gist.github.com/adamkaplan/3c69fda47bf02790a860#file-expexpectawarningdemo-m
My configuration:
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.4.0
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150809/f2f31554/attachment.html>
More information about the llvm-bugs
mailing list