diff --git a/gcc/testsuite/g++.dg/template/lookup18.C b/gcc/testsuite/g++.dg/template/lookup18.C
new file mode 100644
index 0000000000000000000000000000000000000000..38f7347ef5158a37185d783d0c93135d821db819
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/lookup18.C
@@ -0,0 +1,17 @@
+// PR c++/93614
+
+template<class T>
+class foo{};
+
+template<class T>
+class template_class_with_struct
+{
+    void my_method() {
+        if(this->b.foo < 1);
+    };
+
+    struct bar
+    {
+        long foo;
+    } b;
+};