Skip to content

Commit 5d796bf

Browse files
authored
Remove 'using namespace std' to fix __noop ambiguity with latest libc++ (#5406)
A recent change to libc++ added a 'struct __noop' to the 'std' namespace. When building with clang-cl using libc++ on Windows, this now introduces an ambiguity between this std::__noop struct, and the MSVC __noop intrinsic, in translation units where 'using namespace std;' is used. This commit replaces these with using clauses for the exact symbols required in the non-test cpp files.
1 parent 32379dd commit 5d796bf

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

lib/HLSL/DxilValidation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
#include <deque>
6161

6262
using namespace llvm;
63-
using namespace std;
63+
using std::unique_ptr;
64+
using std::unordered_set;
65+
using std::vector;
6466

6567
///////////////////////////////////////////////////////////////////////////////
6668
// Error messages.

lib/HLSL/WaveSensitivityAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include <unordered_set>
4141

4242
using namespace llvm;
43-
using namespace std;
43+
using std::map;
4444

4545
namespace hlsl {
4646

lib/IR/Statepoint.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "llvm/IR/Statepoint.h"
1717
#include "llvm/Support/CommandLine.h"
1818

19-
using namespace std;
2019
using namespace llvm;
2120

2221
bool llvm::isStatepoint(const ImmutableCallSite &CS) {

0 commit comments

Comments
 (0)