18.04 (Bionic)
I visited http://apt.llvm.org/bionic/dists/ (i.e. bionic distributions).
I determined that 6.0 was the latest major version of the toolchain.
I assume that you'll want the linker, lld, also.
# grab the key that LLVM use to GPG-sign binary distributions
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-6.0 main"
sudo apt-get install -y clang-6.0 lld-6.0
This gives you binaries with the following names (and more, probably):
clang-6.0
clang++-6.0
lld-6.0
ld.lld-6.0
It also installs these packages (and more):
llvm-6.0
llvm-6.0-dev
llvm-6.0-runtime
17.04 (Artful)
Same as above. I'll repeat every line for convenient copy-paste.
# grab the key that LLVM use to GPG-sign binary distributions
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-add-repository "deb http://apt.llvm.org/artful/ llvm-toolchain-artful-6.0 main"
sudo apt-get install -y clang-6.0 lld-6.0
16.04 (Xenial)
The accepted answer already gives instructions for installing clang-3.8 on 16.04, but here's how to get clang-6.0:
# grab the key that LLVM use to GPG-sign binary distributions
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
sudo apt-get install -y clang-6.0 lld-6.0