From 865bb54591322223474f0f04a3954aa442ffa662 Mon Sep 17 00:00:00 2001
From: Seth Hillbrand <seth@kipro-pcb.com>
Date: Sun, 17 Jul 2022 20:15:22 -0700
Subject: [PATCH] Flag ERC error on non-stacked pins

Pins that are explicitly connected in the schematic should not have an
"unconnected pin" ERC error.  But stacked pins do not count as
explicitly connected because the schematic designer has not connected
them
---
 eeschema/connection_graph.cpp | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp
index c1b2a72305..1a6945aae5 100644
--- a/eeschema/connection_graph.cpp
+++ b/eeschema/connection_graph.cpp
@@ -2714,9 +2714,21 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
             {
             case SCH_PIN_T:
             {
-                // Only consider a connection to be between pins on different symbols
-                if( !pins.empty() && ( item->GetParent() != pins.front()->GetParent() ) )
-                    has_other_connections = true;
+                // Stacked pins do not count as other connections but non-stacked pins do
+                if( !has_other_connections && !pins.empty() )
+                {
+                    SCH_PIN* pin = static_cast<SCH_PIN*>( item );
+
+                    for( SCH_PIN* other_pin  : pins )
+                    {
+                        if( other_pin->GetParent() != pin->GetParent()
+                                || other_pin->GetPosition() != pin->GetPosition() )
+                        {
+                            has_other_connections = true;
+                            break;
+                        }
+                    }
+                }
 
                 pins.emplace_back( static_cast<SCH_PIN*>( item ) );