(Reference: https://en.cppreference.com/w/cpp/keyword)
C++11 keywords
The listings package has built in support for C++11. Use language = [11]C++ option to alignas (no pun intended) C++11:
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\lstset{
language = [11]C++,
basicstyle = \ttfamily,
keywordstyle = \color{blue},
columns = flexible
}
\begin{document}
\begin{lstlisting}
constexpr int i = 0;
\end{lstlisting}
\end{document}
This yields the desired result:

C++11 identifiers with special meaning
Treated as keywords
C++11 introduces two identifiers with special meaning: override and final. By default, they are not highlighted.
You can add them manually to the keyword list:
\lstset{
morekeywords = {final, override}
}
Minimal example:
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\lstset{
language = [11]C++,
basicstyle = \ttfamily,
keywordstyle = \color{blue},
columns = flexible
}
\lstset{
morekeywords = {final, override}
}
\begin{document}
\begin{lstlisting}
override
final
\end{lstlisting}
\end{document}
This yields:

Treated specially
If you want differentiate between keywords and identifiers with special meaning,
you can override (no pun intended) this by introducing a special emphasis class for them:
\lstset{
emph = {[11]final, override},
emphstyle = \color{green}
}
Minimal example:
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\lstset{
language = [11]C++,
basicstyle = \ttfamily,
keywordstyle = \color{blue},
columns = flexible
}
\lstset{
emph = {[11]final, override},
emphstyle = \color{green}
}
\begin{document}
\begin{lstlisting}
constexpr
override
final
\end{lstlisting}
\end{document}
This yields the final (no pun intended) result:

Other
For future reference, here I give the list of C++20 keywords, C++20 identifiers with special meaning, etc. If the maintainer of the listings package sees this, please add the relevant part to language = [20]C++!
C++20 keywords
\lstset{
morekeywords = {
char8_t,
concept,
co_await,
co_return,
co_yield,
requires
}
}
C++20 identifiers with special meaning
\lstset{
emph = {[20]
import,
module
}
}
(Note: the original version included audit and axiom. The Contract TS was later removed from C++20, so audit and axiom are no longer identifiers with special meaning in C++20.)
Transactional Memory Technical Specification (TM TS) keywords
\lstset{
morekeywords = {
atomic_cancel,
atomic_commit,
atomic_noexcept,
synchronized
}
}
Transactional Memory Technical Specification (TM TS) identifiers with special meaning
\lstset{
emph = {[42]
transaction_safe,
transaction_dynamic
}
}
Reflection TS
\lstset{
morekeywords = {
reflexpr
}
}
(Note: all numbers were chosen arbitrarily. Don't forget to adjust them to avoid name clash with existing identifier classes!)
\begin{lstlisting}[language={[11]C++}]. – user4417 Jun 15 '21 at 10:54