How to dump clang version

is there way to dump the version of clang something like
gcc -dumpversion.

clang -v gives lot more information
[deleisha@deleisha CertificateProvider]$ clang -v
clang version 3.0 (tags/RELEASE_30/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[deleisha@deleisha CertificateProvider]$

i m interested to get only 3.0 without any further processing.

–Dev

is there way to dump the version of clang something like
gcc -dumpversion.

Have you tried the obvious?
clang -dumpversion

Oh, It works, last time when I tried, It was not. and I dig more and last time, it did not work due to a typos.
Thanks

–Dev

but
[deleisha@deleisha CertificateProvider]$ clang++ -dumpversion
4.2.1
[deleisha@deleisha CertificateProvider]$ clang -v
clang version 3.0 (tags/RELEASE_30/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[deleisha@deleisha CertificateProvider]$

why this difference, sorry for silly questions

-dumpversion is used only for compat with GCC and should not be used to determine clang actual version, and so it returns the last GCC version clang pretends to be.

Usually you shouldn’t try to enable feature based on clang version. Why do you need it ?

We thought of porting our project to clang, and make it require clang V 3 and above, as clang 2.9 can not link properly.
So on detection of lesser version, We would like to print that version is not supported.

so need the version number.

This is the trick I use in my Makefiles. I need to find clang's version to pick
the directory from which I can take clang's include files.

# Get the clang version.
VERSION := $(shell $(ELLCC)/bin/ecc -v |& grep version |& sed "s/.*version
\([0-9]*\.[0-9]*\).*/\1/")

I wish there were an easier way.

-Rich