From 29cafa66ad3878dbb9f82615f19fa0bded2e443c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 12 Jun 2011 15:46:16 +0000 Subject: Vendor import of clang trunk r132879: http://llvm.org/svn/llvm-project/cfe/trunk@132879 --- test/SemaTemplate/instantiate-function-1.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/SemaTemplate/instantiate-function-1.cpp') diff --git a/test/SemaTemplate/instantiate-function-1.cpp b/test/SemaTemplate/instantiate-function-1.cpp index 688d0095267ad..5406fbcd1baf7 100644 --- a/test/SemaTemplate/instantiate-function-1.cpp +++ b/test/SemaTemplate/instantiate-function-1.cpp @@ -225,3 +225,25 @@ namespace PR7016 { template void f() { T x = x; } template void f(); } + +namespace PR9880 { + struct lua_State; + struct no_tag { char a; }; // (A) + struct yes_tag { long a; long b; }; // (A) + + template + struct HasIndexMetamethod { + template + static no_tag check(...); + template + static yes_tag check(char[sizeof(&U::luaIndex)]); + enum { value = sizeof(check(0)) == sizeof(yes_tag) }; + }; + + class SomeClass { + public: + int luaIndex(lua_State* L); + }; + + int i = HasIndexMetamethod::value; +} -- cgit v1.2.3