[C++] Fix unmatched_paren2.mk
diff --git a/testcase/unmatched_paren2.mk b/testcase/unmatched_paren2.mk
index c1ba29b..faa947c 100644
--- a/testcase/unmatched_paren2.mk
+++ b/testcase/unmatched_paren2.mk
@@ -1,5 +1,4 @@
-# TODO
-# do we need to support this?
+# TODO(go): do we need to support this?
foo = FOO
bar = BAR
diff --git a/value.cc b/value.cc
index 29a8b45..68a33ce 100644
--- a/value.cc
+++ b/value.cc
@@ -404,11 +404,13 @@
return new VarSubst(vname->Compact(), pat, subst);
}
-#if 0
+ // GNU make accepts expressions like $((). See unmatched_paren*.mk
+ // for detail.
size_t found = s.find(cp);
- if (found
- return NULL;
-#endif
+ if (found != string::npos) {
+ *index_out = s.size();
+ return new SymRef(Intern(s.substr(2, found-2)));
+ }
ERROR("%s:%d: *** unterminated variable reference.", LOCF(loc));
}
}