[Bug c++/11332] [3.3?/3.4 regression] Spurious error with casts in ?: expression

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Thu Jun 26 16:46:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332



------- Additional Comments From bangerth at dealii dot org  2003-06-26 16:46 -------
Forget the code and the error message, of course. On shouldn't change it
in the last minute. Here's the correct code and message:

------------------------------------
struct B {};

int main () {
  B a;
  (1 ? static_cast<B&>(a) :
       *static_cast<B*>(&a));
}
-------------------------------------

tmp/gg> ~/tmp/build-gcc/gcc-install/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:6: error: operands to ?: have different types



More information about the Gcc-bugs mailing list