This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55513] [4.7/4.8 Regression] Incorrect snprintf folding when building with -std=c++0x


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55513

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-28 15:15:11 UTC ---
In cp_parser_constant_expression when we call cp_parser_assignment_expression
on the initializer, it returns
((char *) __builtin_memcpy ((char *) &str, (const char *) "Hello", 6);, 5)
As this is C++11, we call potential_rvalue_constant_expression which returns
true (the call in the COMPOUND_EXPR is builtin, and all its arguments are
pontential_rvalue_constant_expression arguments).  I bet somewhere later on we
see that it is const and ignore the TREE_SIDE_EFFECTS initializer.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]