]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]
authorNathaniel Shead <nathanieloshead@gmail.com>
Fri, 24 May 2024 15:03:54 +0000 (01:03 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sat, 25 May 2024 00:31:55 +0000 (10:31 +1000)
commit28b508233a12c13295f960a2cb8a4864879acfb4
treeadb51a279ef16bbc659ada1db478857b9f648f68
parent6c0b7e12e51cfcc58d6b7dfe9c822c7a720fddd7
c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

If a user mistakenly includes a standard library header within the
module purview, they currently get a confusing "declaration conflicts
with builtin" error.  This patch updates the message to include "in
module", to help guide the user towards the likely cause.

PR c++/102345

gcc/cp/ChangeLog:

* module.cc (module_may_redeclare): Update error message.

gcc/testsuite/ChangeLog:

* g++.dg/modules/enum-12.C: Test for updated error.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/enum-12.C