Skip to content
Snippets Groups Projects
  • Jakub Jelinek's avatar
    9789ba46
    re PR c++/41774 (ice: vector VEC(visibility,base) pop domain error, in... · 9789ba46
    Jakub Jelinek authored
    re PR c++/41774 (ice: vector VEC(visibility,base) pop domain error, in pop_visibility at c-pragma.c:757)
    
    	PR c++/41774
    	* c-pragma.c (visstack): Change into vector of ints rather than
    	enum symbol_visibility.
    	(push_visibility): Add kind argument, push default_visibility together
    	with kind.
    	(pop_visibility): Add kind argument, return true if successful, fail
    	if visibility stack is empty or if stack top is of different kind.
    	(handle_pragma_visibility): Don't check length of visstack, instead
    	call pop_visibility and issue diagnostics if it failed.  Pass 0
    	as last argument to push_visibility and pop_visibility.
    	* c-pragma.h (push_visibility): Add kind argument.
    	(pop_visibility): Likewise.  Return bool instead of void.
    
    	* name-lookup.c (handle_namespace_attrs): Pass 1 as last argument to
    	push_visibility.
    	* parser.c (cp_parser_namespace_definition): Pass 1 as argument to
    	pop_visibility.
    	* rtti.c (push_abi_namespace): Pass 2 as last argument to
    	push_visibility.
    	(pop_abi_namespace): Pass 2 as argument to pop_visibility.
    
    	* g++.dg/ext/visibility/namespace3.C: New test.
    
    From-SVN: r153805
    9789ba46
    History
    re PR c++/41774 (ice: vector VEC(visibility,base) pop domain error, in...
    Jakub Jelinek authored
    re PR c++/41774 (ice: vector VEC(visibility,base) pop domain error, in pop_visibility at c-pragma.c:757)
    
    	PR c++/41774
    	* c-pragma.c (visstack): Change into vector of ints rather than
    	enum symbol_visibility.
    	(push_visibility): Add kind argument, push default_visibility together
    	with kind.
    	(pop_visibility): Add kind argument, return true if successful, fail
    	if visibility stack is empty or if stack top is of different kind.
    	(handle_pragma_visibility): Don't check length of visstack, instead
    	call pop_visibility and issue diagnostics if it failed.  Pass 0
    	as last argument to push_visibility and pop_visibility.
    	* c-pragma.h (push_visibility): Add kind argument.
    	(pop_visibility): Likewise.  Return bool instead of void.
    
    	* name-lookup.c (handle_namespace_attrs): Pass 1 as last argument to
    	push_visibility.
    	* parser.c (cp_parser_namespace_definition): Pass 1 as argument to
    	pop_visibility.
    	* rtti.c (push_abi_namespace): Pass 2 as last argument to
    	push_visibility.
    	(pop_abi_namespace): Pass 2 as argument to pop_visibility.
    
    	* g++.dg/ext/visibility/namespace3.C: New test.
    
    From-SVN: r153805