[LLVMbugs] [Bug 7489] New: clang++ generates invalid binary for legal code.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Jun 24 16:19:27 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7489
Summary: clang++ generates invalid binary for legal code.
Product: clang
Version: trunk
Platform: PC
OS/Version: FreeBSD
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: lists at eitanadler.com
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Created an attachment (id=5107)
--> (http://llvm.org/bugs/attachment.cgi?id=5107)
preprocessed source from -save-temps
I'm sorry about the bad summary I'm not sure exactly where the problem is.
%cat generror.cpp
#include <iostream>
using std::cout;
class Fish
{
protected:
int prot_id;
public:
Fish(int id):prot_id(id+2)
{}
};
class GoldFish : public Fish
{
public:
int getprot_id()
{
return prot_id;
}
GoldFish(int id):Fish(id){}
};
int main()
{
GoldFish GF(33);
cout << "\n" << GF.getprot_id();
return 1;
}
% clang++ -v -Wall -Wextra -ansi -pedantic -save-temps generror.cpp && ./a.out
clang version 2.0 (trunk)
Target: i386-portbld-freebsd8.1
Thread model: posix
"/usr/local/bin/clang" -cc1 -triple i386-portbld-freebsd8.1 -E -disable-free
-main-file-name generror.cpp -mrelocation-model static -mdisable-fp-elim
-mconstructor-aliases -target-cpu pentium4 -v -resource-dir
/usr/local/lib/clang/2.0 -Wall -Wextra -pedantic -std=c++98 -ferror-limit 19
-fmessage-length 140 -fexceptions -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o generror.ii -x c++ generror.cpp
clang -cc1 version 2.0 based upon llvm 2.8svn hosted on i386-portbld-freebsd8.1
ignoring duplicate directory "/usr/include/c++/4.2"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.2
/usr/include/c++/4.2/backward
/usr/local/include
/usr/local/lib/clang/2.0/include
/usr/include
End of search list.
"/usr/local/bin/clang" -cc1 -triple i386-portbld-freebsd8.1 -S -disable-free
-main-file-name generror.cpp -mrelocation-model static -mdisable-fp-elim
-mconstructor-aliases -target-cpu pentium4 -v -resource-dir
/usr/local/lib/clang/2.0 -Wall -Wextra -pedantic -std=c++98 -ferror-limit 19
-fmessage-length 140 -fexceptions -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o generror.s -x c++-cpp-output generror.ii
clang -cc1 version 2.0 based upon llvm 2.8svn hosted on i386-portbld-freebsd8.1
ignoring duplicate directory "/usr/include/c++/4.2"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.2
/usr/include/c++/4.2/backward
/usr/local/include
/usr/local/lib/clang/2.0/include
/usr/include
End of search list.
"/usr/local/bin/as" --32 -o generror.o generror.s
"/usr/local/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 -m
elf_i386_fbsd -o a.out /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
generror.o -lstdc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc
--as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
zsh: bus error (core dumped) ./a.out
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list