Bug#705066: g++-4.7: wrong line indicated in warning for synthesized method
Package: g++-4.7
Version: 4.7.2-5
Severity: minor
$ g++ -c -std=c++11 -Wunused-parameter test.cpp
test.cpp:3:8: warning: unused parameter ‘p’ [-Wunused-parameter]
test.cpp: In function ‘int main()’:
test.cpp:21:17: note: synthesized method ‘A& A::operator=(A&&)’ first
required here
$ cat test.cpp
#include <functional>
struct A // line pointed-to by warning
{
struct B
{
B& operator=(B&&) { return *this; }
};
B f;
A() = default;
A& operator=(A&& p) = default; // where the method is declared
};
int main()
{
A a;
A b;
b = std::move(a);
}
$ g++ -v
Using built-in specs.
COLLECT_GCC=/usr/bin/g++-4.7.real
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-
bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-
languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7
--enable-shared --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-
gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-
sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-
time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-
arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64
-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)
-- System Information:
Debian Release: 7.0
APT prefers testing-proposed-updates
APT policy: (500, 'testing-proposed-updates'), (500, 'testing'), (401, 'experimental'), (400, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.8.5 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages g++-4.7 depends on:
ii gcc-4.7 4.7.2-5
ii gcc-4.7-base 4.7.2-5
ii libc6 2.13-38
ii libgmp10 2:5.0.5+dfsg-2
ii libmpc2 0.9-4
ii libmpfr4 3.1.0-5
ii libstdc++6-4.7-dev 4.7.2-5
ii zlib1g 1:1.2.7.dfsg-13
g++-4.7 recommends no packages.
Versions of packages g++-4.7 suggests:
ii g++-4.7-multilib 4.7.2-5
ii gcc-4.7-doc 4.7.2-2
pn libstdc++6-4.7-dbg <none>
-- no debconf information
Reply to: