aboutsummaryrefslogtreecommitdiff
path: root/test/CXX
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-07-05 14:23:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-07-05 14:23:59 +0000
commitc192b3dcffd5e672a2b2e1730e2440febb4fb192 (patch)
treeac719b5984165053bf83d71142e4d96b609b9784 /test/CXX
parent2e645aa5697838f16ec570eb07c2bee7e13d0e0b (diff)
downloadsrc-c192b3dcffd5e672a2b2e1730e2440febb4fb192.tar.gz
src-c192b3dcffd5e672a2b2e1730e2440febb4fb192.zip
Vendor import of clang trunk r241361:vendor/clang/clang-trunk-r241361
Notes
Notes: svn path=/vendor/clang/dist/; revision=285165 svn path=/vendor/clang/clang-trunk-r241361/; revision=285166; tag=vendor/clang/clang-trunk-r241361
Diffstat (limited to 'test/CXX')
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp4
-rw-r--r--test/CXX/drs/dr9xx.cpp29
2 files changed, 33 insertions, 0 deletions
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp
index f7b3e8e7be63..c3dc1de3ed6f 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp
@@ -11,6 +11,9 @@ namespace std {
int i;
int &&f();
+template <typename T>
+void overloaded_fn(T); // expected-note {{possible target}}
+
using Int = int;
using IntLRef = int&;
using IntRRef = int&&;
@@ -57,6 +60,7 @@ decltype(auto) ((((((v1)))))) = 0; // ok
decltype(auto) v2[1] = { 0 }; // expected-error {{cannot form array of 'decltype(auto)'}}
decltype(auto) &v3 = { 0 }; // expected-error {{cannot form reference to 'decltype(auto)'}}
decltype(auto) *v4 = { 0 }; // expected-error {{cannot form pointer to 'decltype(auto)'}}
+decltype(auto) v5 = &overloaded_fn; // expected-error {{could not be resolved}}
auto multi1a = 0, &multi1b = multi1a;
auto multi1c = multi1a, multi1d = multi1b;
diff --git a/test/CXX/drs/dr9xx.cpp b/test/CXX/drs/dr9xx.cpp
index 4bcd6565e068..b37e17d6b098 100644
--- a/test/CXX/drs/dr9xx.cpp
+++ b/test/CXX/drs/dr9xx.cpp
@@ -44,3 +44,32 @@ namespace dr990 { // dr990: 3.5
D d{};
#endif
}
+
+namespace dr948 { // dr948: 3.7
+#if __cplusplus >= 201103L
+ class A {
+ public:
+ constexpr A(int v) : v(v) { }
+ constexpr operator int() const { return v; }
+ private:
+ int v;
+ };
+
+ constexpr int id(int x)
+ {
+ return x;
+ }
+
+ void f() {
+ if (constexpr int i = id(101)) { }
+ switch (constexpr int i = id(2)) { default: break; case 2: break; }
+ for (; constexpr int i = id(0); ) { }
+ while (constexpr int i = id(0)) { }
+
+ if (constexpr A i = 101) { }
+ switch (constexpr A i = 2) { default: break; case 2: break; }
+ for (; constexpr A i = 0; ) { }
+ while (constexpr A i = 0) { }
+ }
+#endif
+}