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/CXX/temp/temp.spec/temp.explicit/p10.cpp | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p10.cpp (limited to 'clang/test/CXX/temp/temp.spec/temp.explicit/p10.cpp') diff --git a/clang/test/CXX/temp/temp.spec/temp.explicit/p10.cpp b/clang/test/CXX/temp/temp.spec/temp.explicit/p10.cpp new file mode 100644 index 0000000..290a874 --- /dev/null +++ b/clang/test/CXX/temp/temp.spec/temp.explicit/p10.cpp @@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template +struct X0 { + void f(T&); + + struct Inner; + + static T static_var; +}; + +template +void X0::f(T& t) { + t = 1; // expected-error{{incompatible type}} +} + +template +struct X0::Inner { + T member; +}; + +template +T X0::static_var = 1; // expected-error{{cannot initialize}} + +extern template struct X0; +template struct X0; // expected-note 2{{instantiation}} + +template struct X0; // expected-note 4{{explicit instantiation definition is here}} + +extern template void X0::f(int&); // expected-error{{follows explicit instantiation definition}} +extern template struct X0::Inner; // expected-error{{follows explicit instantiation definition}} +extern template int X0::static_var; // expected-error{{follows explicit instantiation definition}} +extern template struct X0; // expected-error{{follows explicit instantiation definition}} -- cgit v1.2.3