------- Comment #2 from gdr at integrable-solutions dot net 2006-07-17 16:51 ------- Subject: Re: New: [4.2 regression] Issue with anonymous namespace
"jakub at redhat dot com" <[EMAIL PROTECTED]> writes: | template<const char *str> | const char *baz () | { | return str; | } | | namespace { char foo[] = "foo"; }; | | const char * | bar () | { | return baz<foo> (); | } | | used to compile before the "make anon-namespace non-public" changes and still | compiles when the anon namespace is changed for a named namespace and using | namespace below it. This is a bug in the compiler. I have always warned people that the unnamed namespace transformation to "static" should happen in the *back-end*, not in the front-end using language rules, because the language rules are slightly different in those cases. But, at the time people said I was considering theoretical problems. The ability to have the compiler do "would be nice" transformation should not take over our ability for the compiler to have valid codes and generate good executable. -- Gaby -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28407