Re: nothrow?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2009-03-08 at 22:27 -0700, Ian Lance Taylor wrote:
> Michael Sullivan <msulli1355@xxxxxxxxx> writes:
> 
> > I wrote a program, and when I compile it, I get:
> >
> > michael@camille OurRPG $ make
> > g++ -O2 -W -Wall -pedantic `sdl-config --cflags` -c draw.cpp
> > enemyparty.o allyparty.o
> > /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/memory: In function
> > 'std::pair<_Tp*, int> std::__get_temporary_buffer(ptrdiff_t, _Tp*)':
> > /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/memory:83: error:
> > 'nothrow' was not declared in this scope
> > /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/memory: In function
> > 'void std::return_temporary_buffer(_Tp*)':
> > /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/memory:123: error:
> > 'nothrow' was not declared in this scope
> >
> > Is this a bug?
> 
> We don't know.  You need to give us more information, like the complete
> command line, and the source code.  See http://gcc.gnu.org/bugs.html .
> 
> nothrow would normally be defined by <new>.
> 
> Ian

Here's the command line:

michael@camille OurRPG $ gcc -O2 -W -Wall -pedantic `sdl-config
--cflags` -c character.cpp
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/memory: In function
'std::pair<_Tp*, int> std::__get_temporary_buffer(ptrdiff_t, _Tp*)':
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/memory:83: error:
'nothrow' was not declared in this scope
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/memory: In function
'void std::return_temporary_buffer(_Tp*)':
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/memory:123: error:
'nothrow' was not declared in this scope

And here's the code of character.cpp and character.h:

michael@camille OurRPG $ cat character.*
#include "character.h"


Character::Character(void)
{
}

Character::~Character(void)
{
}

string Character::getName() { return name; }
void Character::setName(string n) { name = n; }

int Character::getCurHP() { return curHP; }
void Character::setCurHP (int hp) { curHP = hp; }

int Character::getMaxHP() { return maxHP;}
void Character::setMaxHP(int hp) { maxHP = hp; }

int Character::getCurMP() { return curMP; }
void Character::setCurMP(int mp) { curMP = mp; }

int Character::getMaxMP() { return maxMP; }
void Character::setMaxMP(int mp) { maxMP = mp; }

int Character::getX() { return xPos; }
void Character::setX (int x) { xPos = x; }

int Character::getY() { return yPos; }
void Character::setY(int y) 
{ 
	yPos = y; 
} 

string Character::getIMFileName() 
{ 
	return imageMapFileName; 
}
void Character::setIMFileName(string fn) 
{ 
	imageMapFileName = "./" + fn; 
}


int Character::getCurImage() { return curImage; }
void Character::setCurImage (int ci) { curImage = ci; } 
#pragma once

#include <string>
using namespace std;

class Character
{
private:
	string name;
	int curHP;
	int curMP;

	int maxHP;
	int maxMP;

	int xPos;
	int yPos;

	string imageMapFileName;

	int curImage;

public:
	Character(void);
	~Character(void);

	string getName();
	void setName(string n);

	int getCurHP();
	void setCurHP(int hp);

	int getCurMP();
	void setCurMP(int mp);

	int getMaxHP();
	void setMaxHP(int hp);

	int getMaxMP();
	void setMaxMP(int m);

	string getIMFileName();
	void setIMFileName(string fn);

	int getX();
	void setX(int x);

	int getY();
	void setY(int y);
	
	int getCurImage();
	void setCurImage (int ci);
};

As you can see, nowhere is 'nothrow' even mentioned.  The fact that the
error message said that nothrow was not defined "in this scope" suggests
to me that the compiler knows what nothrow is supposed to be, but that
it shouldn't exist.  This particular file compiled fine until I ugraded
glib.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux