Run them:
ln -s test.X test.c
ln -s test.X test.cpp
$ gcc -std=c99 test.c && ./a.out
C
$ clang -std=c99 test.c && ./a.out
C
$ g++ test.cpp && ./a.out
C++
Compare the errors:
$ diff -u <(clang -DWITH_ERRS test.c 2>&1 | grep -Eo ':[0-9]+:') <(g++ -DWITH_ERRS test.cpp 2>&1 | grep -Eo ':[0-9]+:') | wc -l
0