[Bug 1172951] Re: gcc 4.7.3-1ubuntu10 c++11 bogus errors (reduced, not reproducible upstream)
Andy Lutomirski
1172951 at bugs.launchpad.net
Thu Apr 25 23:30:39 UTC 2013
I think this is c++/56388 upstream. r198010 on the 4.7 branch seems to
fix it.
--
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 “gcc-defaults” package in Ubuntu:
New
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/ubuntu/+source/gcc-defaults/+bug/1172951/+subscriptions
More information about the foundations-bugs
mailing list