All pastes #2121535 Raw Edit

Clang fail

public cpp v1 · immutable
#2121535 ·published 2012-02-25 17:54 UTC
rendered paste body
union X {  int x;  X(int x):x(x) { }  virtual int y() { return x; }};#include <iostream>int main() {  X z = 42;  (&z)->y();}/* gcc:$ g++ x.ccx.cc:5:17: error: function ‘y’ declared virtual inside a unionx.cc: In function ‘int main()’:x.cc:12:9: error: ‘union X’ has no member named ‘y’*//* clang 3.0:$ clang++ x.cc$ ./a.out Segmentation fault (core dumped)*/