[Bug 1172951] Re: gcc 4.7.3-1ubuntu10 c++11 bogus errors (reduced, not reproducible upstream)
Matthias Klose
doko at ubuntu.com
Fri Apr 26 11:07:31 UTC 2013
** Package changed: gcc-defaults (Ubuntu) => gcc-4.7 (Ubuntu)
** Changed in: gcc-4.7 (Ubuntu)
Importance: Undecided => Medium
** Changed in: gcc-4.7 (Ubuntu)
Status: New => Confirmed
** Bug watch added: GCC Bugzilla #56388
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56388
** Also affects: gcc via
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56388
Importance: Unknown
Status: Unknown
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1172951
Title:
gcc 4.7.3-1ubuntu10 c++11 bogus errors (reduced, not reproducible
upstream)
Status in The GNU Compiler Collection:
Unknown
Status in “gcc-4.7” package in Ubuntu:
Confirmed
Bug description:
This code:
namespace NS {
struct A
{
static void foo(int);
template<typename Func>
void func(Func f)
{
[&](){
do {
do {
if (1)
foo(0);
} while(0);
} while (0);
};
}
};
}
void caller()
{
NS::A a;
a.func([&]{});
}
Fails like this on Raring:
redeclaration_bug.cc: In instantiation of 'NS::A::func(Func) [with Func = caller()::<lambda()>]::<lambda()>':
redeclaration_bug.cc:14:11: required from 'struct NS::A::func(Func) [with Func = caller()::<lambda()>]::<lambda()>'
redeclaration_bug.cc:10:5: required from 'void NS::A::func(Func) [with Func = caller()::<lambda()>]'
redeclaration_bug.cc:26:15: required from here
redeclaration_bug.cc:14:11: error: redeclaration of 'NS::A* const NS::A::func(Func) [with Func = caller()::<lambda()>]::<lambda()>::__this'
redeclaration_bug.cc:14:11: note: previous declaration 'NS::A* const NS::A::func(Func) [with Func = caller()::<lambda()>]::<lambda()>::__this'
redeclaration_bug.cc:14:11: error: redeclaration of 'NS::A* const this'
redeclaration_bug.cc:14:11: error: 'NS::A* const this' previously declared here
redeclaration_bug.cc: In instantiation of 'void NS::A::func(Func) [with Func = caller()::<lambda()>]':
redeclaration_bug.cc:26:15: required from here
redeclaration_bug.cc:10:5: error: too many initializers for 'NS::A::func(Func) [with Func = caller()::<lambda()>]::<lambda()>'
It compiles fine on Fedora 18's gcc 4.7.2 as well as a version of the
upstream 4.7 branch that I just built today. (The latter calls itself
4.7.4.)
To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1172951/+subscriptions
More information about the foundations-bugs
mailing list