]> granicus.if.org Git - clang/commit
Fix an error in TreeTransform where we failed to copy the TemplateName's
authorChandler Carruth <chandlerc@gmail.com>
Fri, 1 Apr 2011 02:03:23 +0000 (02:03 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 1 Apr 2011 02:03:23 +0000 (02:03 +0000)
commita35d5d7700b519d713039afd31477e95e2da7aa7
treea2552f1bba39ffeccc671fffd3762cca43a791a1
parentd553408ff15b38710a1ba0947efbf4c5637018ab
Fix an error in TreeTransform where we failed to copy the TemplateName's
location into a TemplateSpecializationTypeLoc. These were found using
a hand-written program to inspect every source location in
TemplateSpecializationTypeLocs and Valgrind. I don't know of any way to
test them in Clang's existing test suite sadly.

Example code that triggers the ElaboratedType case:
  template <typename T> struct X1 {
    template <typename U> struct X1_1 {
      int x;
    };
  };

  template <typename T, typename U> struct X2 {
    typename X1<T>::template X1_1<U> B;
  };

  X2<char, int> x2;

The other fix was simply spotted by inspection. I audited all constructions of
[Dependent]TemplateSpecializationTypeLocs in TreeTransform.h, and the rest set
the TemplateNameLoc properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128702 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/TreeTransform.h