[flang-commits] [flang] [flang][acc] Disallow duplicate variables in use_device clause (PR #176217)

Razvan Lupusoru via flang-commits flang-commits at lists.llvm.org
Thu Jan 15 11:18:25 PST 2026


================
@@ -1766,6 +1788,17 @@ Symbol *AccAttributeVisitor::ResolveAccCommonBlockName(
   return nullptr;
 }
 
+void AccAttributeVisitor::AddUseDeviceObject(
+    const Symbol &object, const parser::Name &name) {
+  auto result = useDeviceObjects_.insert(object);
+  if (!result.second) {
+    context_.Say(name.source,
+        "'%s' appears in more than one USE_DEVICE clause "
----------------
razvanlupusoru wrote:

Great point - fixed.

https://github.com/llvm/llvm-project/pull/176217


More information about the flang-commits mailing list