Diagnostic 319: name followed by "::" must be a class or namespace


Cause: 

This diagnostic occurs when a qualifier is not preceded by a class or namespace name. 

Example: 

class C {
   static int i;
};

typedef int Foo;

int Foo::i;  // error -- Foo is not a class or namespace


> icl -c diag319.cpp
Intel® C++ Compiler Professional for applications running on IA-32, Version 11.1    Build 20090511 Package ID: w_cproc_p_11.1.035
Copyright (C) 1985-2009 Intel Corporation.  All rights reserved.

diag319.cpp
diag319.cpp(7): error: name followed by "::" must be a class or namespace name
  int Foo::i;
      ^


Resolution: 

Quality the name correctly.  For example:

int C::i;    // ok, C is a class name
For more complete information about compiler optimizations, see our Optimization Notice.

2 comments

Top
Jennifer J. (Intel)'s picture

You're probably using the 10.1 compiler.
Please use the 11.0 or Parallel Composer that comes with Parallel Studio at "www.intel.com/go/parallel".

anonymous's picture

Hi, I am compiling software that has previously been compiled using VC++ without a problem. Using the Intel compiler I get this error when trying to access the value of an enum using namespace notation. For example if I declare an enumerated type

enum Numbers { one, two, three};

then using "Numbers::one" is my code produces this diagnostic error.

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.