Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions clang/lib/AST/Expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,10 @@ std::string PredefinedExpr::ComputeName(PredefinedIdentKind IK,
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
if (MD->isVirtual() && IK != PredefinedIdentKind::PrettyFunctionNoVirtual)
Out << "virtual ";
if (MD->isStatic())
Out << "static ";
if (MD->isStatic()) {
if (!ForceElaboratedPrinting)
Out << "static ";
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (MD->isStatic()) {
if (!ForceElaboratedPrinting)
Out << "static ";
}
if (MD->isStatic() && !ForceElaboratedPrinting)
Out << "static ";

}

class PrettyCallbacks final : public PrintingCallbacks {
Expand Down
31 changes: 31 additions & 0 deletions clang/test/SemaCXX/source_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,37 @@ TestClass<test_func::C> t2;
TestStruct<test_func::S> t3;
TestEnum<test_func::E> t4;

class A { int b;};
namespace inner {
template <class Ty>
class C {
public:
template <class T>
static void f(int i) {
(void)i;
#ifdef MS
static_assert(is_equal(__FUNCTION__, "test_func::inner::C<class test_func::A>::f"));
#else
static_assert(is_equal(__FUNCTION__, "f"));
#endif
}
template <class T>
static void f(double f) {
(void)f;
#ifdef MS
static_assert(is_equal(__FUNCTION__, "test_func::inner::C<class test_func::A>::f"));
#else
static_assert(is_equal(__FUNCTION__, "f"));
#endif
}
};
}

void foo() {
test_func::inner::C<test_func::A>::f<char>(1);
test_func::inner::C<test_func::A>::f<void>(1.0);
}

} // namespace test_func


Expand Down