summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2013-11-14 20:16:51 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-11-14 20:16:51 +0000
commit4699e99ae8aae2dcb12b84d7d9516a08f5c8dc8a (patch)
tree6d59cdf20f8923f0d77ccbba3fdef079f1e2533b /gcc/testsuite
parent03a231f7521b62a593fd7a4ce7067102288bd28f (diff)
downloadgcc-4699e99ae8aae2dcb12b84d7d9516a08f5c8dc8a.tar.gz
re PR c++/57887 (nested non-type template parameters not declared in this scope)
/cp 2013-11-14 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57887 * parser.c (cp_parser_late_parsing_nsdmi): Call maybe_begin_member_template_processing. * pt.c (maybe_begin_member_template_processing): Handle NSDMIs. (inline_needs_template_parms): Adjust. /testsuite 2013-11-14 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57887 * g++.dg/cpp0x/nsdmi-template3.C: New. * g++.dg/cpp0x/nsdmi-template4.C: Likewise. From-SVN: r204818
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-template3.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-template4.C24
3 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dd787dda559..2077304a55c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/57887
+ * g++.dg/cpp0x/nsdmi-template3.C: New.
+ * g++.dg/cpp0x/nsdmi-template4.C: Likewise.
+
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gcc.target/powerpc/ppc64-abi-1.c (stack_frame_t): Remove
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template3.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template3.C
new file mode 100644
index 00000000000..8a6f913d215
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template3.C
@@ -0,0 +1,16 @@
+// PR c++/58760
+// { dg-do compile { target c++11 } }
+
+enum en
+{
+ a,b,c
+};
+
+struct B
+{
+ template<en N>
+ struct A
+ {
+ const int X = N;
+ };
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template4.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template4.C
new file mode 100644
index 00000000000..ff8dc7e932b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template4.C
@@ -0,0 +1,24 @@
+// PR c++/57887
+// { dg-do compile { target c++11 } }
+
+struct B
+{
+ template<int N>
+ struct A
+ {
+ int X = N;
+ };
+};
+
+template<int M>
+struct C
+{
+ int Y = M;
+
+ template<int N>
+ struct A
+ {
+ int X = N;
+ int Y = M;
+ };
+};