fix Issue 11720 - Function-local static variables should cause "already defined in another scope" error