You probably have a directory (or folder if you prefer) in your current directory called
M123
change the destination name to something else, or rename the directory/folder.
e.g. :
[k5054@localhost]$ ls
hello.cpp
[k5054@localhost]$ mkdir hello
[k5054@localhost]$ ls
hello hello.cpp
[k5054@localhost]$ clang++ hello.cpp -o hello
/usr/bin/ld: cannot open output file hello: Is a directory
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
[k5054@localhost]$ clang++ hello.cpp -o helloworld
[k5054@localhost]$ ./helloworld
Hello World
[k5054@localhost]$