🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: be.comp.programming
2 messages
2 total messages Started by Simon Vandemoortele Sun, 02 Feb 2003 10:55
Enkel voor C++ gurus
#6157
Author: Simon Vandemoortele
Date: Sun, 02 Feb 2003 10:55
47 lines
2070 bytes
Ik wil mij niet belachelijk maken bij de mensen van gcc door te
suggereren dat dit een bug is als het niet zo is ... :O)

#+v
class Test {
  public:
    Test() {} ;
    Test(int i):value(i) {};
    int value;
};

int main()
{ 
  Test(5);     /* compiles */
  Test();      /* compiles */
  (Test(5));   /* compiles */
  (Test());    /* does not compile ---> why ??? */
  return 0;
}
#-v

#+v
$> gcc -v
  Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)
$> g++ -Wall -g3 gcc_bug.cpp
gcc_bug.cpp: In function `int main()':
gcc_bug.cpp:13: parse error before `;
#-v



Is dit een bug ?  Zo niet, waarom compileert dat niet ?


  Alvast bedankt,
  Simon


P.S.: Ja, ik weet dat ik dat kan nagaan door de C++ standaard na te
lezen maar ik heb het er niet voor over om een boek van 500 blz lezen voor
zo iets onbenullig.

-- 
Small things make base men proud.
		-- William Shakespeare, "Henry VI"
Re: Enkel voor C++ gurus
#6160
Author: Dominique Devriese
Date: Sun, 02 Feb 2003 17:06
15 lines
1686 bytes
Simon Vandemoortele writes:

  Simon>  (Test()); /* does not compile ---> why ???
  Simon> P.S.: Ja, ik weet dat ik dat kan nagaan door de C++ standaard
  Simon> na te lezen maar ik heb het er niet voor over om een boek van
  Simon> 500 blz lezen voor zo iets onbenullig.

misschien dat je het beter eens vraagt op comp.programming.c++ of
zoiets, want het lijkt me echt zo'n guru-vitterij ;)
sjuus
domi

-- 
A light wife doth make a heavy husband.
		-- Wm. Shakespeare, "The Merchant of Venice"
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads