[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings |
Date: |
Sun, 15 Apr 2018 15:01:54 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 |
Follow-up Comment #8, bug #53650 (project octave):
I don't know enough about lambdas to speculate about whether this warning is
valid or not.
All I can say is that this warning message comes in two forms, "lambda capture
'foo' is not used", and "lambda capture 'foo' is not required to be captured
for this use", which is the one we are getting here.
I looked at cppreference, and they say that a value can be used without a
capture when it is constexpr. So I tried the following
constexpr T zero = T ();
return std::count_if (d, d + nel,
[] (T elem) { return elem != zero; });
This compiles just fine with GCC 7, and seems correct if I'm understanding the
spec, but clang 6 throws an error.
So far the only changes that work for me with no warnings and no errors for
both compilers are to make 'zero' a non-const variable, or to remove 'zero'
entirely and use the 'T()' constructor inline in the lambda expression.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?53650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Mike Miller, 2018/04/14
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Rik, 2018/04/14
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Mike Miller, 2018/04/14
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Mike Miller, 2018/04/14
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Rik, 2018/04/15
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Rik, 2018/04/15
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Mike Miller, 2018/04/15
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Rik, 2018/04/15
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings,
Mike Miller <=
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Mike Miller, 2018/04/15
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Rik, 2018/04/15
- [Octave-bug-tracker] [bug #53650] build: clang-6.0 compiler warnings, Mike Miller, 2018/04/17
- [Octave-bug-tracker] [bug #53650] build: silence clang compiler warnings, Mike Miller, 2018/04/17