QualifiedNameType generated for a dependent type name.

Hello.

It seems that clang (r102496) sometimes generates a QualifiedNameType (which is meant to be a non-dependent type) when a DependentNameType should be expected.

Consider the following program fragment:

Hello.

It seems that clang (r102496) sometimes generates a QualifiedNameType
(which is meant to be a non-dependent type) when a DependentNameType
should be expected.

Consider the following program fragment:

template <typename T>
struct S {
  class Inner {};
  Inner a_method();
};

template <typename T>
typename S<T>::Inner a_function();

template <typename T>
typename S<T>::Inner
S<T>::a_method() {}

Both return types for a_function() and a_method() are type dependent,
hence they should be encoded by a DependentNameType. However, it seems
that a QualifiedNameType is generated for a_method().

The name DependentNameType is slightly misleading. It represents dependent types that refer to a member of an unknown specialization, meaning that we can't resolve them to an actual type until we instantiate. With the example you've given, we know that Inner is a member of the current instantiation, so it is correct to use QualifiedNameType.

I don't know how to obtain a detailed description of the AST produced by
clang ... since AST type nodes seems to be just printed rather than
dumped. Anyway, even with the -ast-print option, it can be seen that the
out-of-line definition of a_method() is missing the "typename" keyword.

Right. We don't keep track of whether typename was written in the QualifiedNameType, but we should.