https://bugs.llvm.org/show_bug.cgi?id=35073

            Bug ID: 35073
           Summary: Unexpected -Wunused-value with -std=c++17
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: stephan.bergmann.second...@googlemail.com
                CC: llvm-bugs@lists.llvm.org

At least with recent Clang trunk towards 6.0:

> $ cat test.cc
> struct B {};
> struct Ref { Ref(B *); };
> struct D: B { operator Ref() { return this; } };
> void f() { Ref(*new D); }
>
> $ clang++ -std=c++14 -fsyntax-only test.cc
>
> $ clang++ -std=c++17 -fsyntax-only test.cc
> test.cc:4:12: warning: expression result unused [-Wunused-value]
> void f() { Ref(*new D); }
>            ^   ~~~~~~
> 1 warning generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to