From 5a1a35c5ca1b565c95fd4fc25d7eff86187f0264 Mon Sep 17 00:00:00 2001 From: Sudrut Date: Fri, 16 Jan 2026 13:22:02 +0800 Subject: [PATCH] fix: remove unexpected prefix '#' of a link --- src/content/docs/cpp/language/basic_concepts/as_if.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/cpp/language/basic_concepts/as_if.mdx b/src/content/docs/cpp/language/basic_concepts/as_if.mdx index 9f037261..4d13798f 100644 --- a/src/content/docs/cpp/language/basic_concepts/as_if.mdx +++ b/src/content/docs/cpp/language/basic_concepts/as_if.mdx @@ -54,7 +54,7 @@ _Observable behavior_ of a program includes the following: Because the compiler is (usually) unable to analyze the code of an external library to determine whether it does or does not perform I/O or volatile access, third-party library calls also aren't affected by optimization. However, standard library calls may be replaced by other calls, eliminated, or added to the program during optimization. Statically-linked third-party library code may be subject to link-time optimization. -Programs with undefined behavior often change observable behavior when recompiled with different optimization settings. For example, if a test for signed integer overflow relies on the result of that overflow, e.g. `if (n + 1 < n) abort();`, [it is removed entirely by some compilers](#https://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html) because signed overflow is undefined behavior and the optimizer is free to assume it never happens and the test is redundant. +Programs with undefined behavior often change observable behavior when recompiled with different optimization settings. For example, if a test for signed integer overflow relies on the result of that overflow, e.g. `if (n + 1 < n) abort();`, [it is removed entirely by some compilers](https://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html) because signed overflow is undefined behavior and the optimizer is free to assume it never happens and the test is redundant. Copy elision is an exception from the as-if rule: the compiler may remove calls to move- and copy-constructors and the matching calls to the destructors of temporary objects even if those calls have observable side effects.