Opened 9 years ago

Closed 8 years ago

#5150 closed feature request (fixed)

GHC should support -x objective-cpp, as well

Reported by: scpmw Owned by:
Priority: normal Milestone: 7.2.1
Component: Driver Version: 7.0.3
Keywords: Cc:
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: objcpp-hi
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This is a follow-up to #5025: Adding objective-c is just part of the story, as objective-c++ files (with suffix ".mm" or ".M") are also pretty common. Thoughtpolice even mentioned this in the comments.

As with #5025, this would make compiling for Mac a lot easier without any real complications for GHC, as it only has to pass the file through to GCC with the appropriate flag.

Change History (4)

comment:1 Changed 9 years ago by scpmw

Shamelessly copying both the code as well as the approach of thoughtpolice... Here are two Github branches that should implement the required functionality, including a testcase:

comment:2 Changed 9 years ago by igloo

Milestone: 7.2.1
Status: newpatch

Thanks, we'll take a look.

comment:3 Changed 8 years ago by peter@…

commit e17c1568baf142c2d2ddca4a4b4a7ba5a4ceddca

Author: Peter Wortmann <>
Date:   Fri Apr 22 10:35:35 2011 +0100

    Teach GHC to compile objective-c++ files as well (trac #5150)

 compiler/main/DriverPhases.hs   |    8 +++++++-
 compiler/main/DriverPipeline.hs |    3 ++-
 ghc/Main.hs                     |    2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

comment:4 Changed 8 years ago by igloo

Resolution: fixed
Status: patchclosed

Applied, thanks

Note: See TracTickets for help on using tickets.