From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../test/SemaTemplate/partial-spec-instantiate.cpp | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 clang/test/SemaTemplate/partial-spec-instantiate.cpp (limited to 'clang/test/SemaTemplate/partial-spec-instantiate.cpp') diff --git a/clang/test/SemaTemplate/partial-spec-instantiate.cpp b/clang/test/SemaTemplate/partial-spec-instantiate.cpp new file mode 100644 index 0000000..a93af50 --- /dev/null +++ b/clang/test/SemaTemplate/partial-spec-instantiate.cpp @@ -0,0 +1,50 @@ +// RUN: %clang_cc1 -fsyntax-only %s + +// PR4607 +template struct X {}; + +template <> struct X +{ + static char* g(); +}; + +template struct X2 {}; + +template +struct X2 { + static void f() { + X::g(); + } +}; + +void a(char *a, char *b) {X2::f();} + +namespace WonkyAccess { + template + struct X { + int m; + }; + + template + class Y; + + template + struct Y : X { }; + + template<> + struct Y : X { }; + + int f(Y y, Y y2) { + return y.m + y2.m; + } +} + +// +namespace rdar9169404 { + template struct X { }; + template struct X { + typedef int type; + }; + + X::type value; +} -- cgit v1.2.3