The following code snippet triggers an ICE since GCC 3.0 (it disappeared in 3.3.[2-6]):
======================================= struct A { A(int); }; void foo(volatile A a) { 1 ? a : 0; } ======================================= bug.cc: In function 'void foo(A)': bug.cc:6: error: no matching function for call to 'A::A(volatile A)' bug.cc:3: note: candidates are: A::A(int) bug.cc:2: note: A::A(const A&) bug.cc:6: error: initializing temporary from result of 'A::A(int)' bug.cc:6: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in build_conditional_expr, at cp/call.c:3326 Please submit a full bug report, [etc.] I'm not sure whether the error message before the ICE is correct or whether the code is in fact valid. -- Summary: [4.0/4.1/4.2 regression] ICE with volatile in conditional expression Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, monitored Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27666