title: C++ "expected primary-expression before ‘(’ token" error
body: <p>I have this code:</p>
  
  <pre><code>FILE *f = fopen(intPath, "r");
  Node *n;
  if (f) {
      try {
          n = parse(f, intPath);
      } catch (SyntaxError e) {
          fclose(f); /***** line 536 *****/
          throw LangException(
              builtin_classes::exception_class::create_ImportError(
                  String::fromAscii(e.filename)-&gt;
                  append(String::fromAscii(":"))-&gt;
                  append(String::fromInt(e.line))-&gt;
                  append(String::fromAscii(":"))-&gt;
                  append(String::fromInt(e.col))-&gt;
                  append(String::fromAscii(": syntax error: "))-&gt;
                  append(String::fromAscii(e.message))
          );
      }
      fclose(f);
      return n-&gt;eval(scope);
  } else {
      throw LangException(
          builtin_classes::exception_class::create_ImportError(
              String::fromAscii("failed to open file for reading")
          ),
          line,
          col
      );
  }
  </code></pre>
  
  <p>And the compiler gives this error:</p>
  
  <blockquote>
    <p>nodes.cpp:537:40: error: expected primary-expression before <code>‘(’</code> token<br>
    nodes.cpp:544:94: error: expected <code>‘)’</code> before <code>‘;’</code> token</p>
  </blockquote>
  
  <p>I have no clue what it could be, especially since that code sample has another statement which does the same thing, and it doesn't cause an error.</p>