public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21903] New: Default argument of template function causes a compile-time error
@ 2005-06-03 20:13 SSacek at appsecinc dot com
  2005-06-03 20:22 ` [Bug c++/21903] " pinskia at gcc dot gnu dot org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: SSacek at appsecinc dot com @ 2005-06-03 20:13 UTC (permalink / raw)
  To: gcc-bugs

Compile the test program below using this command line:

    g++ test.cpp

The code below fails to compile, and gives the following error message:

  -bash-3.00$ g++ test.cpp
  test.cpp: In member function `void Test::cell_test()':
  test.cpp:36: error: the default argument for parameter 1 of `void 
Test::Cell_base<Type>::set(Type, bool) [with Type = const char*]' has not yet 
been parsed




class Test
{
protected:
	template< typename Type >  class Cell_base
	{
	protected:
		bool	m_relevance;
		Type	m_field;

	public:
		Cell_base (void)				// the 
constructor
			:	m_relevance( false ),
				m_field( Type() )
		{  }

		// the setter
		void set (Type value, bool relevance = true)
		{
			m_relevance = relevance;
			m_field = value;
		}
	};

	class Cell : public Cell_base< const char * >
	{
	};

public:
	//--------------------------------------------------
	//	Test out the cell classes
	//--------------------------------------------------
	void cell_test (void)
	{
		Cell c;
		c.set( "   To be or not to be   \n\n" );
	}
};

//------------------------------
//	Main - program entry
//------------------------------
int main (int argc, char **argv)
{
	Test t;
	t.cell_test();
	return 0;
}

-- 
           Summary: Default argument of template function causes a compile-
                    time error
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: SSacek at appsecinc dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2005-08-15 12:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-03 20:13 [Bug c++/21903] New: Default argument of template function causes a compile-time error SSacek at appsecinc dot com
2005-06-03 20:22 ` [Bug c++/21903] " pinskia at gcc dot gnu dot org
2005-06-03 21:51 ` bangerth at dealii dot org
2005-06-03 22:03 ` pinskia at gcc dot gnu dot org
2005-06-03 22:27 ` bangerth at dealii dot org
2005-06-03 22:27 ` bangerth at dealii dot org
2005-06-03 23:09 ` pinskia at gcc dot gnu dot org
2005-06-04  4:37 ` bangerth at dealii dot org
2005-06-04 10:46 ` giovannibajo at libero dot it
2005-06-04 10:48 ` giovannibajo at libero dot it
2005-06-04 18:28 ` SSacek at appsecinc dot com
2005-06-04 19:17 ` SSacek at appsecinc dot com
2005-06-06  9:35 ` nathan at gcc dot gnu dot org
2005-06-06  9:45 ` giovannibajo at libero dot it
2005-06-06 14:27 ` [Bug c++/21903] [3.4/4.0/4.1 regression] " bangerth at dealii dot org
2005-06-06 14:28 ` bangerth at dealii dot org
2005-06-06 17:29 ` cvs-commit at gcc dot gnu dot org
2005-06-06 17:30 ` nathan at gcc dot gnu dot org
2005-06-09  7:47 ` [Bug c++/21903] [3.4/4.0 " cvs-commit at gcc dot gnu dot org
2005-06-09  7:47 ` [Bug c++/21903] [4.0 " nathan at gcc dot gnu dot org
2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
2005-07-12 11:28 ` nathan at gcc dot gnu dot org
2005-07-12 11:31 ` cvs-commit at gcc dot gnu dot org
2005-08-15 12:04 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).