-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C++ ApiView: Add Support for the [[nodiscard]] attribute; clean up so…
…me ApiView diffs. (#7973) * Added nodiscard support; Exclude line numbers from diffs * Exclude friend declarations in the std namespace and in the _detail namespace * Update pool --------- Co-authored-by: Daniel Jurek <[email protected]>
- Loading branch information
1 parent
0576e8f
commit d71260a
Showing
12 changed files
with
197 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ clangSerialization | |
clangTooling | ||
clangEdit | ||
clangAnalysis | ||
clangASTMatchers | ||
) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
tools/apiview/parsers/cpp-api-parser/ParseTests/TestCases/FriendsTests.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include <iostream> | ||
|
||
namespace MyTest { | ||
|
||
class M1 { | ||
int intVal{}; | ||
|
||
bool isIntValEqual(const M1& other) const { return intVal == other.intVal; } | ||
}; | ||
|
||
namespace _detail { | ||
|
||
class DetailedClass { | ||
int intVal{}; | ||
|
||
bool isIntValEqual(const DetailedClass& other) const { return intVal == other.intVal; } | ||
}; | ||
} // namespace _detail | ||
|
||
class M2 { | ||
int intVal{}; | ||
|
||
bool isIntValEqual(const M2& other) const { return intVal == other.intVal; } | ||
friend class M1; | ||
friend class _detail::DetailedClass; | ||
friend std::ostream& operator<<(std::ostream& os, const M2& m2); | ||
}; | ||
|
||
std::ostream& operator<<(std::ostream& os, const M2& m2) | ||
{ | ||
os << m2.intVal; | ||
return os; | ||
} | ||
} // namespace MyTest |
Oops, something went wrong.