summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/linkage2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/linkage2.cpp')
-rw-r--r--clang/test/SemaCXX/linkage2.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/linkage2.cpp b/clang/test/SemaCXX/linkage2.cpp
index 3cfa98138ba..ed6e9677d5a 100644
--- a/clang/test/SemaCXX/linkage2.cpp
+++ b/clang/test/SemaCXX/linkage2.cpp
@@ -1,5 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -verify -fmodules %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++11-extensions -Wno-local-type-template-args %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++11-extensions -Wno-local-type-template-args -fmodules %s
namespace test1 {
int x; // expected-note {{previous definition is here}}
@@ -65,7 +66,7 @@ namespace test6 {
get_future();
template <class _Rp>
struct shared_future<_Rp&> {
- shared_future(future<_Rp&>&& __f); // expected-warning {{rvalue references are a C++11 extension}}
+ shared_future(future<_Rp&>&& __f);
};
void f() {
typedef int T;
@@ -164,3 +165,24 @@ namespace test16 {
}
}
}
+
+namespace test17 {
+ namespace {
+ struct I {
+ };
+ }
+ template <typename T1, typename T2> void foo() {}
+ template <typename T, T x> void bar() {} // expected-note {{candidate function}}
+ inline void *g() {
+ struct L {
+ };
+ // foo<L, I>'s linkage should be the merge of UniqueExternalLinkage (or
+ // InternalLinkage in c++11) and VisibleNoLinkage. The correct answer is
+ // NoLinkage in both cases. This means that using foo<L, I> as a template
+ // argument should fail.
+ return reinterpret_cast<void*>(bar<typeof(foo<L, I>), foo<L, I> >); // expected-error {{reinterpret_cast cannot resolve overloaded function 'bar' to type 'void *}}
+ }
+ void h() {
+ g();
+ }
+}
OpenPOWER on IntegriCloud