[modules] Add missing #include, found by modules build. We need a class

definition in order to apply isa<...>.

llvm-svn: 214151
This commit is contained in:
Richard Smith 2014-07-29 00:51:47 +00:00
parent 5466a0fbc4
commit 05ad411aa2
4 changed files with 10 additions and 2 deletions

View File

@ -15,6 +15,7 @@
#ifndef LLVM_CLANG_SEMA_SCOPE_INFO_H
#define LLVM_CLANG_SEMA_SCOPE_INFO_H
#include "clang/AST/Expr.h"
#include "clang/AST/Type.h"
#include "clang/Basic/CapturedStmt.h"
#include "clang/Basic/PartialDiagnostic.h"
@ -41,8 +42,6 @@ class SwitchStmt;
class TemplateTypeParmDecl;
class TemplateParameterList;
class VarDecl;
class DeclRefExpr;
class MemberExpr;
class ObjCIvarRefExpr;
class ObjCPropertyRefExpr;
class ObjCMessageExpr;

View File

@ -75,3 +75,10 @@ template<typename T> struct MergeTemplateDefinitions {
template<typename T> constexpr int MergeTemplateDefinitions<T>::f() { return 1; }
template<typename T> using AliasTemplate = T;
template<typename T> struct PartiallyInstantiatePartialSpec {};
template<typename T> struct PartiallyInstantiatePartialSpec<T*> {
static T *foo() { return reinterpret_cast<T*>(0); }
static T *bar() { return reinterpret_cast<T*>(0); }
};
typedef PartiallyInstantiatePartialSpec<int*> PartiallyInstantiatePartialSpecHelper;

View File

@ -73,4 +73,5 @@ template<typename T> void UseDefinedInBImplIndirectly(T &v) {
void TriggerInstantiation() {
UseDefinedInBImpl<void>();
Std::f<int>();
PartiallyInstantiatePartialSpec<int*>::foo();
}

View File

@ -105,6 +105,7 @@ void g() {
int &p = WithPartialSpecializationUse().f();
int &q = WithExplicitSpecializationUse().inner_template<int>();
int *r = PartiallyInstantiatePartialSpec<int*>::bar();
}
static_assert(Outer<int>::Inner<int>::f() == 1, "");