aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/temp/temp.spec/p5.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/temp/temp.spec/p5.cpp')
-rw-r--r--test/CXX/temp/temp.spec/p5.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.spec/p5.cpp b/test/CXX/temp/temp.spec/p5.cpp
index c37817cc49b8..ba99dd7093a2 100644
--- a/test/CXX/temp/temp.spec/p5.cpp
+++ b/test/CXX/temp/temp.spec/p5.cpp
@@ -27,3 +27,20 @@ template union X0<float>::Inner; // expected-error{{duplicate explicit instantia
template float X0<float>::value; // expected-note{{previous explicit instantiation}}
template float X0<float>::value; // expected-error{{duplicate explicit instantiation}}
+
+// Make sure that we don't get tricked by redeclarations of nested classes.
+namespace NestedClassRedecls {
+ template<typename T>
+ struct X {
+ struct Nested;
+ friend struct Nested;
+
+ struct Nested {
+ Nested() {}
+ } nested;
+ };
+
+ X<int> xi;
+
+ template struct X<int>;
+}