http://llvm.org/bugs/show_bug.cgi?id=14804

             Bug #: 14804
           Summary: Spurious unused expression warning
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Created attachment 9807
  --> http://llvm.org/bugs/attachment.cgi?id=9807
Test to reproduce a spurious unused expression warning on templated classes.

Similar to bug 8806, but I think this one is valid.

I have a templated code that is giving me an "expression result unused"
warning, thinking that an argument list is a comma expression.

Attached is the code, which is highly stripped down from a widely-used
production code (http://www.openvdb.org/). 

Compile as: 

> clang++ -c bogus_unused_expr_warn.cc

If I do either of the things below, the warning goes away, leading me to think
that there's an error in the unused result detection heuristic:
a) Remove the "bool Root=false" from the Item class's template parameter list.
b) Change the Item::probe function to a non-templated function.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to