Files
clang-p2996/clang/test/PCH/friend-template.cpp
Argyrios Kyrtzidis a1c27eb8dd [PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType type
reference instead of relying on computing it.

In general, if storage is no issue, it is preferable to deserialize info from
the PCH instead of trying to recompute it after the PCH was loaded.

The incentive to change this now was due to r155303 changing how friend template
classes in dependent contexts are handled; such classes can now be chained to
a previous template class but the computed InjectedClassNameType may be different
due to the extra template parameters from the dependent context.

The new handling requires more investigation but, in the meantime, writing out
InjectedClassNameType fixes PCH issue in rdar://12627738.

llvm-svn: 167425
2012-11-06 00:35:02 +00:00

47 lines
633 B
C++

// Test this without pch.
// RUN: %clang_cc1 -include %s -fsyntax-only -verify %s
// Test with pch.
// RUN: %clang_cc1 -emit-pch -o %t %s
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
// rdar://12627738
namespace rdar12627738 {
class RecyclerTag {
template <typename T> friend class Recycler;
};
}
#else
namespace rdar12627738 {
template<typename TTag>
class CRN {
template <typename T> friend class Recycler;
};
template<typename T>
class Recycler {
public:
Recycler ();
};
template<typename T>
Recycler<T>::Recycler ()
{
}
}
#endif