https://bugs.llvm.org/show_bug.cgi?id=24684

Fedor Sergeev <fedor.serg...@oracle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED
                 CC|                            |fedor.serg...@oracle.com

--- Comment #6 from Fedor Sergeev <fedor.serg...@oracle.com> ---
OP appears to be confused by Builder.defineMacro functionality.

> It stringifies it, but by the time it's stringified, the std::string from
> getClangFullRepositoryVersion() has gone out of scope.

defineMacro takes a string (well, Twine) argument and pushes it into the 'Out'
stream (which is by itself is a stream on a string buffer). This argument needs
to be alive only for the duration of defineMacro and not any longer.

And for sure, getClangFullRepositoryVersion() return result temporary
std::string leaves till the end of the full expression - which is a function
call to defineMacro in this case. Hence it lives just fine at least till the
end of defineMacro.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to