зеркало из https://github.com/microsoft/clang-1.git
Don't hit an assertion failure when calculating the __PRETTY_FUNCTION__
of a member function with parenthesized declarator. Like this test case: class Foo { const char *(baz)() { return __PRETTY_FUNCTION__; } }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170233 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
12b3e3199c
Коммит
4ae711b5ef
|
@ -510,7 +510,7 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) {
|
||||||
POut << ")";
|
POut << ")";
|
||||||
|
|
||||||
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
|
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
|
||||||
const FunctionType *FT = cast<FunctionType>(MD->getType().getTypePtr());
|
const FunctionType *FT = MD->getType()->castAs<FunctionType>();
|
||||||
if (FT->isConst())
|
if (FT->isConst())
|
||||||
POut << " const";
|
POut << " const";
|
||||||
if (FT->isVolatile())
|
if (FT->isVolatile())
|
||||||
|
|
|
@ -142,7 +142,7 @@ public:
|
||||||
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
|
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void inlineFunction() {
|
inline void (inlineFunction)() {
|
||||||
printf("__func__ %s\n", __func__);
|
printf("__func__ %s\n", __func__);
|
||||||
printf("__FUNCTION__ %s\n", __FUNCTION__);
|
printf("__FUNCTION__ %s\n", __FUNCTION__);
|
||||||
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
|
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче