Does -fsanitize=address cover -fsanitize=leak?

Hi,

I see this page offers confusing information. The example uses
-fsanitize=address, but the text below it says -fsanitize=leak.

When I tried it, it seems that both -fsanitize=leak and
-fsanitize=address are fine? So should -fsanitize=address be used
instead -fsanitize=leak as the former covers more than the latter?
Thanks.

https://clang.llvm.org/docs/LeakSanitizer.html

Hi,

I see this page offers confusing information. The example uses
-fsanitize=address, but the text below it says -fsanitize=leak.

When I tried it, it seems that both -fsanitize=leak and
-fsanitize=address are fine? So should -fsanitize=address be used
instead -fsanitize=leak as the former covers more than the latter?
Thanks.

LeakSanitizer — Clang 15.0.0git documentation

The doc is outdated. I submitted ⚙ D100907 [lsan][docs] Clarify supported platforms to
update the supported platforms and clarify this sentence.

If the executable is linked with -fsanitize=address, indeed it gets
LeakSanitizer by default. See CAN_SANITIZE_LEAKS in
compiler-rt/lib/asan/asan_rtl.cpp