[cfe-dev] clang and gcc implement __PRETTY_FUNCTION__ differently

Kostya Serebryany kcc at google.com
Wed Nov 30 18:21:04 PST 2011


Hi,
Here is one difference between clang and gcc which makes some of our
software fail when built with clang.
is this something you would consider fixing?

Thanks,

--kcc

% cat pretty.cc
#include <stdio.h>
template<class T>
const char *foo() {
  return __PRETTY_FUNCTION__;
}
int main() {
  printf("%s\n", foo<int>());
}
% g++ pretty.cc && ./a.out
const char* foo() [with T = int]
% ~/llvm/build/Release+Asserts/bin/clang++ pretty.cc && ./a.out
const char *foo()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111130/a48e8ca8/attachment.html>


More information about the cfe-dev mailing list