diff options
author | Fred Tingaud <frederic.tingaud@sonarsource.com> | 2022-05-03 09:29:16 +0200 |
---|---|---|
committer | Marco Antognini <marco.antognini@sonarsource.com> | 2022-05-03 11:31:50 +0200 |
commit | ad47114ad8500c78046161d492ac13a8e3e610eb (patch) | |
tree | a39042fa45090efc1b0b09162c9bca17afb532e9 /llvm/lib/Support/CommandLine.cpp | |
parent | bc8e6012577bab2e94babec965f1ad10172432ec (diff) | |
download | llvm-ad47114ad8500c78046161d492ac13a8e3e610eb.zip llvm-ad47114ad8500c78046161d492ac13a8e3e610eb.tar.gz llvm-ad47114ad8500c78046161d492ac13a8e3e610eb.tar.bz2 |
In MSVC compatibility mode, friend function declarations behave as function declarations
Before C++20, MSVC treated any friend function declaration as a function declaration, so the following code would compile despite funGlob being declared after its first call:
```
class Glob {
public:
friend void funGlob();
void test() {
funGlob();
}
};
void funGlob() {}
```
This proposed patch mimics the MSVC behavior when in MSVC compatibility mode
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D124613
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
0 files changed, 0 insertions, 0 deletions