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). --- .../SemaTemplate/operator-function-id-template.cpp | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 clang/test/SemaTemplate/operator-function-id-template.cpp (limited to 'clang/test/SemaTemplate/operator-function-id-template.cpp') diff --git a/clang/test/SemaTemplate/operator-function-id-template.cpp b/clang/test/SemaTemplate/operator-function-id-template.cpp new file mode 100644 index 0000000..9a0884e --- /dev/null +++ b/clang/test/SemaTemplate/operator-function-id-template.cpp @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template +struct A { + template A operator+(U); +}; + +template bool operator==(A, A); + +template<> bool operator==<0>(A, A); + +bool test_qualified_id(A ai) { + return ::operator==<0, int>(ai, ai); +} + +void test_op(A a, int i) { + const A &air = a.operator+(i); +} + +template +void test_op_template(A at, T x) { + const A &atr = at.template operator+(x); + const A &atr2 = at.A::template operator+(x); + // FIXME: unrelated template-name instantiation issue + // const A &atr3 = at.template A::template operator+(x); +} + +template void test_op_template(A, float); -- cgit v1.2.3