We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2079eb2 commit d31600eCopy full SHA for d31600e
clang/lib/Sema/SemaSYCL.cpp
@@ -7302,6 +7302,13 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
7302
}
7303
7304
if (FreeFunctionCount > 0) {
7305
+ // GlobalMapUpdater has to be in an anonymous namespace.
7306
+ // Otherwise, if multiple translation units include the same integration
7307
+ // header, there will be multiple varying definitions of GlobalMapUpdater
7308
+ // with the same name across translation units, violating the C++'s One
7309
+ // Definition Rule. Putting it in an anonymous namespace gives each
7310
+ // translation unit its own unique definition.
7311
+
7312
O << "\n#include <sycl/kernel_bundle.hpp>\n";
7313
O << "#include <sycl/detail/kernel_global_info.hpp>\n";
7314
O << "namespace {\n";
0 commit comments