Skip to content

Latest commit

 

History

History
37 lines (32 loc) · 944 Bytes

compiler-error-c2589.md

File metadata and controls

37 lines (32 loc) · 944 Bytes
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Compiler Error C2589 | Microsoft Docs
11/04/2016
cpp-tools
error-reference
C2589
C++
C2589
1d7942c7-8a81-4bb4-b272-76a0019e8513
9
corob-msft
corob
ghogen

Compiler Error C2589

'identifier' : illegal token on right side of '::'

If a class, structure, or union name appears to the left of the scope-resolution operator (double colons), the token on the right must be a class, structure, or union member. Otherwise, any global identifier can appear on the right.

The scope-resolution operator cannot be overloaded.

The following sample generates C2589:

// C2589.cpp  
void Test(){}  
class A {};  
void operator :: ();   // C2589  
  
int main() {  
   ::Test();  
}