On Jan 9, 2008, at 8:03 PM, Eli Friedman wrote: > See http://llvm.org/bugs/show_bug.cgi?id=1903. Basic test: > > int abcdefghi12(void) { > static const char* s = __func__; > const char (*ss)[12] = &__func__; > return sizeof(__func__); > } > > should not give any errors or warnings, and should return 12. > > The change in Sema/SemaExpr.cpp is changing the type of __func__ > appropriately. > > The changes in AST/Expr.cpp makes __func__ be recognized as an lvalue > with static storage duration. > > The change in CodeGen/CGExpr.cpp keeps codegen working in the presence > of the new type for __func__.
Very nice, applied: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080107/003745.html I wrapped a few lines to 80 columns and changed strlen to ask the identifier its length directly. Also note that your test above works better, but it is still not entirely happy: predef.c:2:25: error: initializer element is not constant static const char* s = __func__; ^~~~~~~~ Thanks Eli, -Chris _______________________________________________ cfe-dev mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
