[cfe-commits] r101953 - /cfe/trunk/lib/AST/Decl.cpp
Chris Lattner
clattner at apple.com
Tue Apr 20 23:13:02 PDT 2010
>>> Can you explain a bit about why this makes you uncomfortable? From my perspective, all of the Objective-C declarations have external linkage since they are visible from multiple translation units.
>>
>> Except for meta-data for the class (and its metaclass), othere meta-data have non-external linkage.
>> Content of all non-external metadata, however, can be inspected with various APIs. In that respect they are 'external'.
>> But not wrt linkage.
>
> I'm looking at linkage more from the language perspective. For example, say we have:
>
> @interface A
> @end
>
> A *an_A;
>
> Is this code well-formed? In C++, it actually depends on the linkage of A: if A has no linkage, then the program is ill-formed because an_A does have linkage. Also, one could imagine instantiating a template over an Objective-C class (or pointer to one), e.g.,
>
> std::vector<A *> a_objects;
>
> which also requires A to have linkage.
How about "if 'a' has a defined/stable mangling, then it has linkage". Is this close enough to be a useful guideline?
-Chris
More information about the cfe-commits
mailing list