mxcl/homebrew — pull request #15775 by int3h (2012-10-31 00:38:20+00:00)
Title: Fix bug where the '-ObjC++' flag was being stripped from compile commands.

The flag "-ObjC++" was being mistaken for "-O2" optimization flags (and its ilk) and being stripped out of compile commands by the superenv module.

I went into the 'cc' command wrapper, and changed the regex that was incorrectly matching the -ObjC++ flag. Specifically, I added a negative lookbehind command to the regex, so that it will not match "-O" if it is immediately proceeded by a 'b'.

This bug was active when trying to install the "anttweakbar" formula. It used the -ObjC++ flag to signal to gcc that it should be compiled as Objective-C++, but the flag was being stripped from the compile command, so the compiler was interpreting the code as C++. This caused the compile command to fail, and the formula to not be installed. This change fixes that.