Skip to content

Bad code generation for typedefs of namespace-d template classes to their own names #2

@GoogleCodeExporter

Description

@GoogleCodeExporter
The following code generates a bad 4robin.cc:
"""
namespace ns {
  template <typename T> 
  class Blah {};
}

typedef ns::Blah<int> Blah;

Blah getBlah() {
  Blah b;
  return b;
}
"""

Griffin works all fine, but the generated code does not compile, with the 
following error:
"""
./4robin.cc:99: error: expected constructor, destructor, or type conversion 
before ‘*’ token
./4robin.cc:123: error: ‘routine_2s0’ was not declared in this scope
"""

The problem is, that instead of substitute "Blah" with "::ns::Blah<int>", it 
substitutes with 
"::ns::Blah" (forgets the template). It does work fine, if the name of the 
typedef is different from 
the real class name.

Original issue reported on code.google.com by misha.seltzer on 4 Jun 2009 at 8:22

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions