[llvm-bugs] [Bug 35073] New: Unexpected -Wunused-value with -std=c++17
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Oct 25 07:52:35 PDT 2017
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: unassignedclangbugs at nondot.org
Reporter: stephan.bergmann.secondary at googlemail.com
CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171025/452c2a2a/attachment.html>
More information about the llvm-bugs
mailing list