Obviously the input is malformed, but probably still should not ICE. regehr@john-home:~/volatile/tmp208$ current-g++ -O small.cpp small.cpp:2:27: internal compiler error: vector VEC(visibility,base) pop domain error, in pop_visibility at c-pragma.c:757 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. regehr@john-home:~/volatile/tmp208$ current-g++ -v Using built-in specs. COLLECT_GCC=current-g++ COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r153044-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../configure --enable-lto --prefix=/home/regehr/z/tmp/gcc-r153044-install --program-prefix=r153044- --enable-languages=c,c++ Thread model: posix gcc version 4.5.0 20091020 (experimental) (GCC) regehr@john-home:~/volatile/tmp208$ cat small.cpp namespace std __attribute__ ((__visibility__ ("default"))) { #pragma GCC visibility pop
Created attachment 18849 [details] gcc45-pr41775.patch Fix I'm going to bootstrap/regtest.
Subject: Bug 41774 Author: jakub Date: Mon Nov 2 13:39:46 2009 New Revision: 153805 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153805 Log: 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. Added: trunk/gcc/testsuite/g++.dg/ext/visibility/namespace3.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-pragma.c trunk/gcc/c-pragma.h trunk/gcc/cp/ChangeLog trunk/gcc/cp/name-lookup.c trunk/gcc/cp/parser.c trunk/gcc/cp/rtti.c trunk/gcc/testsuite/ChangeLog
Fixed.