Sending this again because I think it got lost in an unrelated thread.

The attached patch fixes a crash in the included testcase. It does so
by not trying to compute the LV at a time where me might still not
know it. The problematic sequence right now is:

* We try to find out if f's LV.
* For that we try to find the LV of the argument type.
* For that we try to find the LV of the lambda.
* For that we try to find the LV of the context (which is g).
* hasBody returns false for g, which causes us to get the wrong answer
because of -fvisibility-inlines-hidden.

A downside is that more decls get added to UndefinedInternals only to
be filtered out at the end of the translation unit.

A possible optimization on top of this patch is to add a
hasCachedLinkage method to NamedDecl. If we already know the linkage,
it is safe to use it.

A completely different option is to set a dummy (pointer cast of 1 for
example) body in g's decl while we construct the real one.

Cheers,
Rafael1

Attachment: t.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to