This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52036] C++11 allows template parameters to have internal linkage
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 Jan 2012 19:28:05 +0000
- Subject: [Bug c++/52036] C++11 allows template parameters to have internal linkage
- Auto-submitted: auto-generated
- References: <bug-52036-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52036
--- Comment #7 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-01-30 19:28:05 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > However compilation still fails if pi is given internal linkage by declaring it > static, i.e.
> >
> > int main()
> > {
> > static constexpr float pi = 3.14;
> >
> > Or even:
> >
> > namespace {
> > static constexpr float pi = 3.14;
> > }
>
> I agree that both examples should work and that the lack of that is a bug when
> compiled in C++11 mode. Paolo, this bug should be reopened.
Partial correction: The first example involving a function local static has no
linkage (and should not be accepted), but the second example does.