Closed Bug 511112 Opened 15 years ago Closed 11 years ago

process_type() not receiving template instantiations

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dnovillo, Assigned: taras.mozilla)

Details

Given

# 1 "test.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.cc"


template<typename FOO>
class MyTemplateClass {
  public:
    MyTemplateClass(FOO a) { a_ = a; }
    FOO a() { return a_; }
  private:
    FOO a_;
};
# 20 "test.cc"
template<> class MyTemplateClass<int>;


and the dehydra script:

function process_type(t)
{
  print("Type found: " + t.name + " location: " + t.loc);
}

I would expect to see two types printed, but only the template type is received by 't'.  The specialization is not seen.


Type found: MyTemplateClass<FOO> location: test.cc:4:23

If I add a process_decl() callback, I can access the specialized type via the decl, but I was expecting to see the type in process_type as well.

Bug or feature?
The template hasn't actually been instantiated, has it? Do you get the process_type call if you then use MyTemplateClass<int> in a function?
Right, there is no instantiation for the template.  It's just the forward declaration for the class specialization.  We'd still need to intercept it to analyze the arguments.  Doing it in process_type() seemed the more natural place.

If I specialize the template declaring a variable, process_type() will see it, of course.
Yeah, I don't think GCC gives us the type callback until it is instantiated... either way is fine with me if there's a way to make GCC behave.
Yeah, process_type is basically more or less what gcc gives us. I'll accept a patch for this.
Dehydra and treehydra are no longer maintained by Mozilla.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.