compiler-explorer / compiler-explorer/compiler-explorer

[REQUEST] Add support C++/CLI and CLR

Open
#1,878 3 comments 0 reactions 0 assignees View on GitHub
MS/Windows request
Dominant language
TypeScript
Stars
19.1k
Forks
2.1k
Avg merge
3d 15h
Merged PRs (30d)
67

Description

MSVC can compile [C++/CLI](https://en.wikipedia.org/wiki/C%2B%2B/CLI) with the option [`/clr`](https://docs.microsoft.com/en-us/cpp/build/reference/clr-common-language-runtime-compilation?view=vs-2019). The output will be CLR instructions. Currently CE uses `/EHs` so I have to override it with `/EHa` but it does work. See [demo][1]

The coloring also works perfectly and each line is highlighted correctly for every sample I tried. So supporting it is a lot easier than other languages IMO

[1]: https://godbolt.org/#g:!((g:!((g:!((g:!((h:codeEditor,i:(fontScale:14,j:1,lang:c%2B%2B,selection:(endColumn:26,endLineNumber:17,positionColumn:26,positionLineNumber:17,selectionStartColumn:26,selectionStartLineNumber:17,startColumn:26,startLineNumber:17),source:'int+f1(int+i1,+int+i2)%0A%7B%0A++++return+i1*(i2+%2B+1)%3B%0A%7D%0A%0Avoid+f2(int+input%5B%5D)%0A%7B%0A++++System::Console::WriteLine(f1(input%5B0%5D,+input%5B1%5D))%3B%0A%7D%0A%0Aint+f3(int+%26x,+int+%26y,+int+z,+int+t)+%0A%7B%0A++++x+%3D+2*y%3B%0A++++y+%3D+z+%2B+3*t%3B%0A++++t+-%3D+z/x%3B%0A++++x+*%3D+t%3B%0A++++return+y+%2B+t/4+%2B+z*5%3B%0A%7D%0A'),l:'5',n:'0',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',m:65.99063962558502,n:'0',o:'',s:0,t:'0'),(g:!((h:output,i:(compiler:1,editor:1,fontScale:14,wrap:'1'),l:'5',n:'0',o:'%231+with+x64+msvc+v19.24',t:'0')),header:(),l:'4',m:34.009360374414975,n:'0',o:'',s:0,t:'0')),k:50,l:'3',n:'0',o:'',t:'0'),(g:!((h:compiler,i:(compiler:vcpp_v19_24_x64,filters:(b:'0',binary:'1',commentOnly:'0',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'1',trim:'1'),fontScale:14,j:1,lang:c%2B%2B,libs:!(),options:'/EHa+/clr',selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'x64+msvc+v19.24+(Editor+%231,+Compiler+%231)+C%2B%2B',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.