summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-01-27 16:26:10 +0000
committerHans Wennborg <hans@hanshq.net>2017-01-27 16:26:10 +0000
commitfaf6e6df56928fe2ea5b9fba2c03ccdbf94e218b (patch)
tree083eabb785e085afc220a8c6cb87537acb5316d5 /test
parentcadf1a490f9ae802ad340da5d9e2a272c81efa87 (diff)
Merging r292561:
------------------------------------------------------------------------ r292561 | rsmith | 2017-01-19 17:19:46 -0800 (Thu, 19 Jan 2017) | 3 lines PR31701: Fix crash on invalid caused by parsing a dependent initializer when we don't know we're in a dependent context. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@293297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaCXX/constant-expression.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/constant-expression.cpp b/test/SemaCXX/constant-expression.cpp
index f82a692093..69e846bf0e 100644
--- a/test/SemaCXX/constant-expression.cpp
+++ b/test/SemaCXX/constant-expression.cpp
@@ -143,3 +143,14 @@ namespace rdar16064952 {
}
char PR17381_ice = 1000000 * 1000000; // expected-warning {{overflow}} expected-warning {{changes value}}
+
+namespace PR31701 {
+ struct C {
+ template<int i> static int n; // expected-warning {{extension}}
+ };
+ template <int M> class D;
+ template <int M>
+ template<int i> void D<M>::set() { // expected-error {{from class 'D<M>' without definition}}
+ const C c = C::n<i>;
+ }
+}