On 14 May 2013 16:10, Richard Smith <[email protected]> wrote: > This isn't quite right. You need to scan up to the outermost such entity. > For instance: > > template<typename T> int *get() { static int k; return &k; } > > /*inline*/ > int *f() { > struct S { > int *g() { > struct T {}; > return get<T>(); > } > } s; > return s.g(); > } > > Here, we should not treat get<f::S::g::T> as being externally-visible, but > if we uncomment the 'inline', then it should be externally-visible.
I finally understand what you went by outermost in the bug report. Thanks, a new patch is attached. > (And technically, in either case, getFormalLinkage for get<...> should > return ExternalLinkage.) That is defect is the standard, no? In the non-inline case there is no way for another TU to refer to this and the current draft defines external linkage as * When a name has external linkage , the entity it denotes can be referred to by names from scopes of other translation units or from other scopes of the same translation unit. Cheers, Rafael
t.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
