[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-20 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. @rnk Here is the test case that was broken: https://godbolt.org/z/Gef7PcqMf One point where I was wrong in my initial analysis is that the behavior doesn't actually change based on `/std:c++17` VS `/std:c++latest`, but based on `/permissive` VS `/pe

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-16 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. I haven't given any input yet because I haven't yet seen a reduced example of the conforming code that is broken by this change. If someone can put together a small godbolt example that shows the issue affecting ADL, I'd appreciate it. I don't fully understand the code patt

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-13 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. Thanks, reverted in e0fcdf5496ca686c8cebb63b63af86e666b42ab3 for now. In D124613#3511098 , @frederic-tingaud-sonarsource wrote: > I realized that this current

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-13 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. I realized that this current patch did in fact mimic MSVC behavior up to its mishandling on ADL. I understand that it is not in the spirit of clang's philosophy for MSVC compatibility to have that, but the fixed version I was about to propose would

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-13 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. Sorry for the delay, the fix is here: https://reviews.llvm.org/D125526 If there is any risk or problem identified with this new fix that could delay it, I'll propose a revert of this one to avoid breaking more legitimate code. Repository: rG LLVM

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-12 Thread Pavel Chupin via Phabricator via cfe-commits
pavel.v.chupin added a comment. We faced some similar problem in downstream project (https://github.com/intel/llvm/issues/6142) due to this change. +1 for revert if fix takes longer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124613/new/ https:

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-12 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. Regarding the "why": Our tools (SonarQube / SonarCloud / SonarLint) use the clang front-end to parse our customer's code and find bugs/bad patterns in it. Said customer code can target various compilers including MSVC and we need to handle it as grac

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-11 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. It seems to not affect a ton of code, so I don't think there's a huge hurry. I would like to hear an answer about the question "what is this for?" though, and your thoughts on how this relates to the goals in https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJH

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-11 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. In D124613#3506740 , @thakis wrote: > Should we revert this, at least for now, until the investigation is complete? I started typing my message before you sent yours so it was not a direct answer. We are wor

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-11 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. Thanks a lot for pointing out the reproducer, it made the debug a lot easier. I have pinpointed the problem to an unintended increase in ADL visibility for friend classes. I do have a test-case and fix for that. I'll make a last check tomorrow to mak

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-11 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. Given that: - This is not needed for system headers - Before the change, users had to fix their standards-noncompliant code, but with it, users have to change their previously-compiling, standards-compliant code - The change is a no-op for C++20 and up anyways - There's

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-10 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. I don't think you need to build chromium. https://bugs.chromium.org/p/chromium/issues/detail?id=1323014#c5 has a stand-alone reproducer attached that you can download. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124613/ne

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-09 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. That is definitely not expected. I'm looking into it, but as this is my first time building chromium, I'm taking a bit more time finding my way around. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1246

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-06 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. Thanks for the patch! Two comments, more specific, one general: 1. This broke compilation of (at least) one TU in chromium, see https://bugs.chromium.org/p/chromium/issues/detail?id=1323014#c5 . Can you look into if that's expected? (We've worked around this for now.)

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-05-03 Thread Marco Antognini via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGad47114ad850: In MSVC compatibility mode, friend function declarations behave as function… (authored by frederic-tingaud-sonarsource, committed by mantognini). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-04-29 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. @rnk I don't have the rights to merge. Could you do it when you have the time? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124613/new/ https://reviews.llvm.org/D124613 ___

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-04-28 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource added a comment. I haven't searched far in the past, but I expect this behavior to go way back, yes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124613/new/ https://reviews.llvm.org/D124613 _

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-04-28 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. lgtm I plugged this into godbolt to confirm the behavior of MSVC: https://gcc.godbolt.org/z/v3P3WbxG3 This incompatibility has existed for a long time, right? Repository: rG LLVM Github Monorepo

[PATCH] D124613: In MSVC compatibility mode, friend function declarations behave as function declarations

2022-04-28 Thread Fred Tingaud via Phabricator via cfe-commits
frederic-tingaud-sonarsource created this revision. frederic-tingaud-sonarsource added a reviewer: rnk. Herald added a reviewer: shafik. Herald added a project: All. frederic-tingaud-sonarsource requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits