diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C
new file mode 100644
index 0000000000000000000000000000000000000000..032b7b616199f978244c761a4d480becd35bf09e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C
@@ -0,0 +1,22 @@
+// PR c++/109506
+// { dg-do link { target c++11 } }
+// { dg-additional-options "-fchecking=2" }
+
+template<class T>
+struct foo {
+  foo() { };
+};
+
+template<class T>
+class bar {
+  foo<int> alloc_{};
+};
+
+template<class T>
+bar<int> func1() {
+  return bar<int>{};
+}
+
+int main() {
+  func1<int>();
+}