Bug: 'typename' keyword gives compile errors if used for identifiers inside namespaces

 

We faced a problem with 'typename' keyword gives compile errors if used for identifiers defined inside namespaces.

See this example, it does not even compile

namespace myspace
  {
   int x = 1;
  }

void OnStart(void)
  {
   Print( myspace::x );               // 1

   Print( typename(myspace::x) );     // does not compile unless line is commented-out  ('x' - undeclared identifier)
  }

Edited: 'We' refers to me and @Dominik Christian Egert


Note: If an extra pair of parenthesis is added around the identifier, the problem is gone:

   Print( typename((myspace::x)) );  // int
 
amrali:

We faced a problem with 'typename' keyword gives compile errors if used for identifiers defined inside namespaces.

See this example, it does not even compile

Edited: 'We' refers to me and @Dominik Christian Egert


Note: If an extra pair of parenthesis is added around the identifier, the problem is gone:

The fix with an enclosing bracet will not work on templated types...


template <typename T>
void func_type_id(T p_in, const int __line)
{ printf("line:%i  Type:%s", __line, typename((T))); }

Fails to compile

 
Dominik Christian Egert #:

The fix with an enclosing bracet will not work on templated types...


Fails to compile

Try typename((p_in))
 
I has been fixed.
 
Alain Verleyen #:
I has been fixed.

What build the fix?

I have checked build 3683: not fixed, with the same error.

 
Alain Verleyen #:
I has been fixed.


Great. Thank you for taking care.
 
Dominik Christian Egert #:


Great. Thank you for taking care.
You are welcome.