Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "What happens to an unnamed-namespace variable defined in a header included by three translation units?" on CodeWiki (https://codewiki.com/practice/mcq/cpp/namespaces/unnamed-namespace-header/).
Context (verbatim from the page):
"""
What happens to an unnamed-namespace variable defined in a header included by three translation units?
Each translation unit gets its own internal-linkage entity.
The linker automatically merges all three into one object.
The variable becomes a member of the global namespace with external linkage.
The program is ill-formed solely because the header was included more than once.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in C++. Where you are unsure, say so.