]> granicus.if.org Git - clang/commit
When we encounter a dependent type that was parsed before we know that
authorDouglas Gregor <dgregor@apple.com>
Thu, 6 Aug 2009 16:20:37 +0000 (16:20 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 6 Aug 2009 16:20:37 +0000 (16:20 +0000)
commit4a959d8788179d654df6b213b08d2b064989211d
tree7236eed56d6d12ec441e2b814c60232aa78ae77f
parent8a12b564923a72224730a467007e61b5701e4aa7
When we encounter a dependent type that was parsed before we know that
we were going to enter into the scope of a class template or class
template partial specialization, rebuild that type so that it can
refer to members of the current instantiation, as in code like

  template<typename T>
  struct X {
    typedef T* pointer;
    pointer data();
  };

  template<typename T>
  typename X<T>::pointer X<T>::data() { ... }

Without rebuilding the return type of this out-of-line definition, the
canonical return type of the out-of-line definition (a TypenameType)
will not match the canonical return type of the declaration (the
canonical type of T*).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78316 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/TreeTransform.h
test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1-retmem.cpp