]> granicus.if.org Git - clang/commitdiff
[modules] Add missing #include, found by modules build. We need a class
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 29 Jul 2014 00:51:47 +0000 (00:51 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 29 Jul 2014 00:51:47 +0000 (00:51 +0000)
definition in order to apply isa<...>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214151 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/ScopeInfo.h
test/Modules/Inputs/cxx-templates-a.h
test/Modules/Inputs/cxx-templates-b.h
test/Modules/cxx-templates.cpp

index f2095b67605bc141142f4a7c0c22f99d46ad6d65..d65b1f2cda3e4dc77703c94b89ed875fe01b7d80 100644 (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;
index cfb8902db1e9ec67a44fdb1553c27e45ddac3bf3..0289c8ada82357d47a5da0a95ff449eebbf2d0de 100644 (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;
index 802b9262d8d30a1a87c5f39a4ea9926bd4385865..5dbf1a11216f1396501ec5acab79cd24b28acf40 100644 (file)
@@ -73,4 +73,5 @@ template<typename T> void UseDefinedInBImplIndirectly(T &v) {
 void TriggerInstantiation() {
   UseDefinedInBImpl<void>();
   Std::f<int>();
+  PartiallyInstantiatePartialSpec<int*>::foo();
 }
index cbe9f35089515a9d98b978ea30a4c446a8495cb0..b5036ff956ff1ad515d604d56182857878b2b39d 100644 (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, "");