Visual Studio has the advantage that it can reuse the compiler's parser which it just keeps mapped in RAM. Obviously, there's no way we can do such a thing, because Microsoft certainly won't give anyone enough information to do it.
However, I've heard a friend's cousin's sister say her neighbour told her some guy on the gcc team is allegedly working on some voodoo which might make such a thing possible with gcc some distant day in the future. Though, until we see a working, stable, usable version of it, it's all just talk.
There are modified versions of gcc which let you export their parse data, but they're terribly inefficient for this scenario. Seeing that you want to check syntax as you type, this would mean having to spawn at least 1-2 processes per second (assuming you batch several keypresses into one scan) each of which starts a full parse (possibly reading through 200 include files) and writes out data, which you parse again.
Writing a custom parser is all nice and well, but like everything it has advantages and disadvantages. Compilers have quite a wide range both of implementation details and standard compliance, and often they're seriously tuneable on their behaviour, too. What compiles fine with one may not compile with another at all, or produce a warning, this is no secret. Now, a custom parser would be expected to deal with this in some way, which isn't easy.