[cfe-dev] A patch for Sema::CheckTypenameType.

Enea Zaffanella zaffanella at cs.unipr.it
Sat Apr 24 00:55:49 PDT 2010


Hello.

Please find attached a patch for Sema::CheckTypenameType() that should 
solve a couple of FIXMEs related to the construction of 
DependentNameType nodes. In code such as the following
===============
template <typename T> class S;

template <typename T>
struct Derived : public S<T>::base_type {};
===============
clang was generating a DependentNameType node for the base class of 
Derived where the presence of the keyword "typename" was (wrongly) 
assumed. Hence we were obtaining:

$ llvm/Debug/bin/clang -cc1 -ast-print c.cc
template <typename T> class S;
template <typename T> class Derived : public typename S<T>::base_type {
};


With the attached patch, we get instead:

template <typename T> class S;
template <typename T> struct Derived : public S<T>::base_type {
};

The patch passes all tests (r102070).

Regards,
Enea Zaffanella.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CheckTypenameType.patch
Type: text/x-patch
Size: 5015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100424/8252a340/attachment.bin>


More information about the cfe-dev mailing list