User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090615 Firefox/3.5 Build Identifier: HEAD from June 20th, 2009 This patch adds an "access" property for all global declarations, not just non-static members of classes and structs. I use this in building C++ -> Java bindings to identify static methods that should have native lang accessors. Reproducible: Always Steps to Reproduce: This is a feature enhancement, not a bug.
Created attachment 384771 [details] [diff] [review] patch against dehydra.c The big flaw with this patch is that it copies several static constants from dehyra_types.c that are inaccessible from dehydra.c I'm willing to adjust the patch if someone tells me what would be best (i.e. should I make the constants non-static and put a declaration into a headerfile somewhere?)
(In reply to comment #1) > Created an attachment (id=384771) [details] > patch against dehydra.c > > The big flaw with this patch is that it copies several static constants from > dehyra_types.c that are inaccessible from dehydra.c I'm willing to adjust the > patch if someone tells me what would be best (i.e. should I make the constants > non-static and put a declaration into a headerfile somewhere?) Yeah make them non-static and put them into dehydra.h I don't see how this would affect things outside of class scope. Can you attach a testcase C++ file that works better with your patch?
I can attach a testcase, sure (tomorrow) It is only in class scope. The "TREE_CODE(decl_context) == RECORD_TYPE" matches only things like structs and classes. The issue, apparently is that static members of a class or struct appear as top level definitions. This is why they don't appear in the "members" array of the type for the class and instead appear as a separate top level declaration event. Someone had already added code to populate the "memberOf" property of static definitions. I'm adding only the additional property of "access" right at the same place.
Thanks for the bugreport + fix. cleanedup+testcased+pushed http://hg.mozilla.org/users/tglek_mozilla.com/dehydra-gcc/rev/e3d49bb8ce4f
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.