Skip to content
Snippets Groups Projects
Commit dcb4bd07 authored by Jason Merrill's avatar Jason Merrill
Browse files

c++: also note name used in enclosing class

While looking at PR96645 I noticed that while we were diagnosing names
changing meaning in the full class context, we weren't doing this for
lookups in nested class bodies.

Note that this breaks current range-v3; I've submitted a pull request to fix
its violation of the rule.

gcc/cp/ChangeLog:

	* class.cc (maybe_note_name_used_in_class): Note in all enclosing
	classes.  Remember location of use.
	(note_name_declared_in_class): Adjust.

gcc/testsuite/ChangeLog:

	* g++.dg/lookup/name-clash13.C: New test.
	* g++.dg/lookup/name-clash14.C: New test.
	* g++.dg/lookup/name-clash15.C: New test.
	* g++.dg/lookup/name-clash16.C: New test.
parent 7e1f30d7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment