|
From: SourceForge.net <no...@so...> - 2010-01-13 01:03:21
|
Bugs item #2528856, was opened at 2009-01-22 09:16 Message generated for change (Comment added) made by arcanum You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=520074&aid=2528856&group_id=68108 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: GCC Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Michael Kochnev (st1ng) Assigned to: Nobody/Anonymous (nobody) Summary: pointers in constant-expressions and as template parameters Initial Comment: avr-c++ compiler v4.3.0 const int i1 = 0; int* const pi = ( int* )i1; // cast int to pointer const int i2 = ( int )( int* )i1; // only cast to pointer and back to int template< int i > class SomeTemplate { }; template< int* p > class AnotherTemplate { }; enum SomeEnum { entry_1 = i1, // ok entry_2 = ( int )pi, // error: 'pi' cannot appear in a constant-expression entry_3 = i2 // error: 'i2' cannot appear in a constant-expression }; SomeTemplate< 0 > st; // ok SomeTemplate< i1 > st1;// ok SomeTemplate< ( int )pi > st2;// error: 'pi' cannot appear in a constant-expression SomeTemplate< i2 > st3;// error: 'i2' cannot appear in a constant-expression AnotherTemplate< ( int* )0 > at; // error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression AnotherTemplate< ( int* )i1 > at1;// error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression AnotherTemplate< pi > at2;// error: 'pi' cannot appear in a constant-expression AnotherTemplate< ( int* )i2 > at3;// error: 'i2' cannot appear in a constant-expression ---------------------------------------------------------------------- Comment By: Eric Weddington (arcanum) Date: 2010-01-12 17:37 Message: This needs to be reported to the GCC project at: http://gcc.gnu.org/bugzilla/ This is not a WinAVR bug. The WinAVR User Manual states that any potential bugs in the GCC compiler must be reported to the GCC project and not here. Closed as "Won't Fix." ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=520074&aid=2528856&group_id=68108 |