[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-19 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam closed https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-19 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: Thank you all for the reviews. https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-19 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/84014 >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH 01/10] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. -

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/84014 >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH 01/10] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. -

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -855,7 +865,14 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Out << Proto << " -> "; Proto.clear(); } - AFT->getReturnType().print(Out, Policy, Proto); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -1022,7 +1039,13 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) { ? D->getIdentifier()->deuglifiedName() : D->getName(); - printDeclType(T, Name); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.SuppressUnwrittenScope) {

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I spotted some simplifications that can be applied. If precommit CI comes back green, then I think this is basically ready to go. https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list c

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/84014 >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH 1/9] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. ---

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Zahira Ammarguellat via cfe-commits
@@ -855,7 +868,17 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Out << Proto << " -> "; Proto.clear(); } - AFT->getReturnType().print(Out, Policy, Proto); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -679,6 +679,19 @@ static void printExplicitSpecifier(ExplicitSpecifier ES, llvm::raw_ostream &Out, Out << Proto; } +static void AddPrefix(PrintingPolicy &Policy, QualType T, + llvm::raw_ostream &Out) { + if (!Policy.SuppressTagKeyword && Policy.Supp

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -855,7 +868,17 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Out << Proto << " -> "; Proto.clear(); } - AFT->getReturnType().print(Out, Policy, Proto); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -679,6 +679,19 @@ static void printExplicitSpecifier(ExplicitSpecifier ES, llvm::raw_ostream &Out, Out << Proto; } +static void AddPrefix(PrintingPolicy &Policy, QualType T, AaronBallman wrote: This is a pretty non-descriptive function name; the caller

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -1635,6 +1635,17 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T, if (T->getKeyword() != ElaboratedTypeKeyword::None) OS << " "; NestedNameSpecifier *Qualifier = T->getQualifier(); +if (!Policy.SuppressTagKeyword && Policy.SuppressScope

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -855,7 +868,17 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Out << Proto << " -> "; Proto.clear(); } - AFT->getReturnType().print(Out, Policy, Proto); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -1022,7 +1045,17 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) { ? D->getIdentifier()->deuglifiedName() : D->getName(); - printDeclType(T, Name); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.SuppressUnwrittenScope) {

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread via cfe-commits
Sirraide wrote: >From what I can tell, it seems that Aaron is a lot more familiar w/ this part >of Clang than me, so I’ll leave it to him to comment on whether these changes >make sense. https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-14 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/84014 >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH 1/8] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. ---

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-14 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/84014 >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH 1/7] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. ---

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-14 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 93e423f19fc5317ee208f77d8f36e677db124cc8 4b42f76d5c1e5439311cc8153ef9530be2625840 --

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-14 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/84014 >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH 1/6] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. ---

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread Zahira Ammarguellat via cfe-commits
@@ -1635,6 +1635,17 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T, if (T->getKeyword() != ElaboratedTypeKeyword::None) OS << " "; NestedNameSpecifier *Qualifier = T->getQualifier(); +if (!Policy.SuppressTagKeyword && Policy.SuppressScope

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread Aaron Ballman via cfe-commits
@@ -1635,6 +1635,17 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T, if (T->getKeyword() != ElaboratedTypeKeyword::None) OS << " "; NestedNameSpecifier *Qualifier = T->getQualifier(); +if (!Policy.SuppressTagKeyword && Policy.SuppressScope

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread Zahira Ammarguellat via cfe-commits
@@ -1635,6 +1635,17 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T, if (T->getKeyword() != ElaboratedTypeKeyword::None) OS << " "; NestedNameSpecifier *Qualifier = T->getQualifier(); +if (!Policy.SuppressTagKeyword && Policy.SuppressScope

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread Aaron Ballman via cfe-commits
@@ -1635,6 +1635,17 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T, if (T->getKeyword() != ElaboratedTypeKeyword::None) OS << " "; NestedNameSpecifier *Qualifier = T->getQualifier(); +if (!Policy.SuppressTagKeyword && Policy.SuppressScope

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread Aaron Ballman via cfe-commits
@@ -721,10 +722,21 @@ std::string PredefinedExpr::ComputeName(PredefinedIdentKind IK, return std::string(Out.str()); } if (const FunctionDecl *FD = dyn_cast(CurrentDecl)) { -if (IK != PredefinedIdentKind::PrettyFunction && +const auto &LO = Context.getLangOpts(

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread Aaron Ballman via cfe-commits
@@ -721,10 +722,21 @@ std::string PredefinedExpr::ComputeName(PredefinedIdentKind IK, return std::string(Out.str()); } if (const FunctionDecl *FD = dyn_cast(CurrentDecl)) { -if (IK != PredefinedIdentKind::PrettyFunction && +const auto &LO = Context.getLangOpts(

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/84014 >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH 1/4] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. ---

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread via cfe-commits
@@ -224,6 +224,9 @@ Bug Fixes in This Version for variables created through copy initialization having side-effects in C++17 and later. Fixes (#GH64356) (#GH79518). +- Fix value of predefined macro ``__FUNCTION__`` in MSVC compatibility mode. + Fixes (GH#66114).

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread via cfe-commits
Sirraide wrote: Alright, the changes look sensible to me, but I’d like for someone who’s more familiar with this part of Clang or with the original pr to comment on them too before we merge it. https://github.com/llvm/llvm-project/pull/84014 ___ cfe-

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-06 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -71,12 +76,17 @@ struct A { #endif } ~A() { -clang_analyzer_dump(__func__); -clang_analyzer_dump(__FUNCTION__); -clang_analyzer_dump(__PRETTY_FUNCTION__); -// expected-warning@-3 {{&Element{"~A",0 S64b,char}}} -// expected-warning@-3 {{&Element{"~A",0

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -52,12 +52,17 @@ void foo() { struct A { A() { -clang_analyzer_dump(__func__); -clang_analyzer_dump(__FUNCTION__); -clang_analyzer_dump(__PRETTY_FUNCTION__); -// expected-warning@-3 {{&Element{"A",0 S64b,char}}} -// expected-warning@-3 {{&Element{"A",0

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
https://github.com/Sirraide requested changes to this pull request. https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -224,6 +224,9 @@ Bug Fixes in This Version for variables created through copy initialization having side-effects in C++17 and later. Fixes (#GH64356) (#GH79518). +- Fix value of predefined macro ``__FUNCTION__`` to match MSVC's value. Fixes + (`#66114

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/84014 >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH 1/2] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. ---

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread Zahira Ammarguellat via cfe-commits
@@ -463,8 +463,72 @@ void ctor_tests() { constexpr SL global_sl = SL::current(); static_assert(is_equal(global_sl.function(), "")); +template +class TestBI { +public: + TestBI() { +#ifdef MS + static_assert(is_equal(__FUNCTION__, "test_func::TestBI::TestBI")); + sta

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > Oh, I just noticed that you’ve tried to land this change before (#66120), but > it seems it was reverted because of some problems; if those are fixed now, > then I’d say going forward with this is probably fine, seeing as it was > approved the first time round. > > This woul

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
Sirraide wrote: Oh, I just noticed that you’ve tried to land this change before (https://github.com/llvm/llvm-project/pull/66120), but it seems it was reverted because of some problems; if those are fixed now, then I’d say going forward with this is probably fine, seeing as it was approved the

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -55,9 +55,14 @@ struct A { clang_analyzer_dump(__func__); clang_analyzer_dump(__FUNCTION__); clang_analyzer_dump(__PRETTY_FUNCTION__); -// expected-warning@-3 {{&Element{"A",0 S64b,char}}} -// expected-warning@-3 {{&Element{"A",0 S64b,char}}} -// expe

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Zahira Ammarguellat (zahiraam) Changes Predefined macro FUNCTION in clang is not returning the same string than MS for templated functions. See https://godbolt.org/z/q3EKn5zq4 For the same test case MSVC is returning: function: TestClas

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam ready_for_review https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > I’m not entirely sure this change is a good idea: some people might be > relying on Clang’s behaviour wrt `__FUNCTION__`, especially with how long > it’s been around; Clang may not be fully MSVC-compatible in this case, but > that incompatibilty seems unlikely to cause proble

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
Sirraide wrote: I’m not entirely sure this change is a good idea: some people might be relying on Clang’s behaviour wrt `__FUNCTION__`, especially with how long it’s been around; Clang may not be fully MSVC-compatible in this case, but that incompatibilty seems unlikely to cause problems imo s

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -55,9 +55,14 @@ struct A { clang_analyzer_dump(__func__); clang_analyzer_dump(__FUNCTION__); clang_analyzer_dump(__PRETTY_FUNCTION__); -// expected-warning@-3 {{&Element{"A",0 S64b,char}}} -// expected-warning@-3 {{&Element{"A",0 S64b,char}}} -// expe

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -3741,7 +3741,10 @@ ExprResult Sema::BuildPredefinedExpr(SourceLocation Loc, else { // Pre-defined identifiers are of type char[x], where x is the length of // the string. -auto Str = PredefinedExpr::ComputeName(IK, currentDecl); +bool ForceElaboratedPrinti

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -1635,6 +1635,17 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T, if (T->getKeyword() != ElaboratedTypeKeyword::None) OS << " "; NestedNameSpecifier *Qualifier = T->getQualifier(); +if (!Policy.SuppressTagKeyword && Policy.SuppressScope

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -721,10 +722,17 @@ std::string PredefinedExpr::ComputeName(PredefinedIdentKind IK, return std::string(Out.str()); } if (const FunctionDecl *FD = dyn_cast(CurrentDecl)) { -if (IK != PredefinedIdentKind::PrettyFunction && -IK != PredefinedIdentKind::Pretty

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -463,8 +463,72 @@ void ctor_tests() { constexpr SL global_sl = SL::current(); static_assert(is_equal(global_sl.function(), "")); +template +class TestBI { +public: + TestBI() { +#ifdef MS + static_assert(is_equal(__FUNCTION__, "test_func::TestBI::TestBI")); + sta

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -752,6 +760,8 @@ std::string PredefinedExpr::ComputeName(PredefinedIdentKind IK, PrintingPolicy Policy(Context.getLangOpts()); PrettyCallbacks PrettyCB(Context.getLangOpts()); Policy.Callbacks = &PrettyCB; +if (IK == PredefinedIdentKind::Function && ForceEla

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -2260,10 +2271,15 @@ printTo(raw_ostream &OS, ArrayRef Args, const PrintingPolicy &Policy, } else { if (!FirstArg) OS << Comma; - // Tries to print the argument with location info if exists. - printArgument(Arg, Policy, ArgOS, -

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -74,9 +79,14 @@ struct A { clang_analyzer_dump(__func__); clang_analyzer_dump(__FUNCTION__); clang_analyzer_dump(__PRETTY_FUNCTION__); -// expected-warning@-3 {{&Element{"~A",0 S64b,char}}} -// expected-warning@-3 {{&Element{"~A",0 S64b,char}}} -// ex

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -721,10 +722,17 @@ std::string PredefinedExpr::ComputeName(PredefinedIdentKind IK, return std::string(Out.str()); } if (const FunctionDecl *FD = dyn_cast(CurrentDecl)) { -if (IK != PredefinedIdentKind::PrettyFunction && -IK != PredefinedIdentKind::Pretty

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -463,8 +463,72 @@ void ctor_tests() { constexpr SL global_sl = SL::current(); static_assert(is_equal(global_sl.function(), "")); +template +class TestBI { +public: + TestBI() { +#ifdef MS + static_assert(is_equal(__FUNCTION__, "test_func::TestBI::TestBI")); + sta

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
@@ -463,8 +463,72 @@ void ctor_tests() { constexpr SL global_sl = SL::current(); static_assert(is_equal(global_sl.function(), "")); +template +class TestBI { +public: + TestBI() { +#ifdef MS + static_assert(is_equal(__FUNCTION__, "test_func::TestBI::TestBI")); + sta

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
https://github.com/Sirraide requested changes to this pull request. https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-05 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/84014 None >From bdefe754c14c5e050ebf2b9c82eca458041564a4 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Tue, 5 Mar 2024 05:35:16 -0800 Subject: [PATCH] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. -