summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/temp_arg_nontype.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-25 22:24:25 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-25 22:24:25 +0000
commitd85b5b9b8fcf53906d9a61649b3657ca0d902017 (patch)
tree4c7551b9d56f064196b368224ea44e6b332e60a6 /test/SemaTemplate/temp_arg_nontype.cpp
parent66078610be5e4319de02efa283b07887c73c2e27 (diff)
downloadclang-d85b5b9b8fcf53906d9a61649b3657ca0d902017.tar.gz
clang-d85b5b9b8fcf53906d9a61649b3657ca0d902017.tar.bz2
clang-d85b5b9b8fcf53906d9a61649b3657ca0d902017.tar.xz
Implement the rules in C++ [basic.link] and C99 6.2.2 for computing
the linkage of a declaration. Switch the lame (and completely wrong) NamedDecl::hasLinkage() over to using the new NamedDecl::getLinkage(), along with the "can this declaration be a template argument?" check that started all of this. Fixes -fsyntax-only for PR5597. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89891 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_arg_nontype.cpp')
-rw-r--r--test/SemaTemplate/temp_arg_nontype.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp
index bde92be93d..0c44651ccf 100644
--- a/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/test/SemaTemplate/temp_arg_nontype.cpp
@@ -151,3 +151,12 @@ namespace ns {
Baz<static_cast<ns::E>(0)> b2; // This neither.
}
+// PR5597
+template<int (*)(float)> struct X0 { };
+
+struct X1 {
+ static int pfunc(float);
+};
+void test_X0_X1() {
+ X0<X1::pfunc> x01;
+}