title: Why does GCC require brackets around new before calling a member function?
body: <p>I have a function, which takes an arbitrary number of pointers to a custom class, which are largely instantiated on the spot with new.</p>
  
  <p>Example:</p>
  
  <pre><code>addListItems(
      new Item(1, 2, 3),
      NULL);
  </code></pre>
  
  <p>This works. However as soon as I call an init-function on <code>Item</code> like this:</p>
  
  <pre><code>addListItems(
      new Item(1, 2, 3)-&gt;initMoreStuff(4, 5, 6),
      NULL);
  </code></pre>
  
  <p>my compiler throws me the error: `expected ')' before '->' token.
  As soon as I do:</p>
  
  <pre><code>addListItems(
      (new Item(1, 2, 3))-&gt;initMoreStuff(4, 5, 6),
      NULL);
  </code></pre>
  
  <p>it stops complaining. I've tried this very same code with the BCB 6 without any problem, so why exactly is GCC complaining about that?</p>
  
  <p>If I use a maker-function or put the result of 'new' into a variable prior to adding it into the function, it works as well.</p>
  
  <p>And are there any possible side effects of putting the call to <code>new</code> into the brackets?</p>