This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66543] New: False positive warning "variable set but not used"
- From: "ldionne.2 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Jun 2015 13:34:03 +0000
- Subject: [Bug c++/66543] New: False positive warning "variable set but not used"
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66543
Bug ID: 66543
Summary: False positive warning "variable set but not used"
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ldionne.2 at gmail dot com
Target Milestone: ---
The following code triggers a "unused but set variable" warning on GCC trunk:
int main() {
auto f = []() { };
[=](auto) {
using Foo = decltype(f());
};
}
I think it is a false positive, since `f` is obviously used.
> g++ --version
g++ (GCC) 6.0.0 20150613 (experimental)
> g++ -std=c++14 worksheet.cpp -fsyntax-only -Wall -Wno-unused-local-typedefs
In function âint main()â:
warning: variable âfâ set but not used [-Wunused-but-set-variable]
auto f = []() { };
^
Regards,
Louis Dionne