Bug 40855 - undefined reference to `typeinfo for __int128'
Summary: undefined reference to `typeinfo for __int128'
Status: RESOLVED DUPLICATE of bug 43622
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-25 05:11 UTC by John Salmon
Modified: 2011-09-25 15:04 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-08-25 15:26:14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Salmon 2009-07-25 05:11:58 UTC
When I try to take the typeid of an __int128_t or a __uint128_t, I get an undefined reference at link time, e.g., with gcc/4.4.1:

salmonj@drdblogin6.en.desres$ cat typeid.cpp
#include <typeinfo>

const std::type_info& ti(typeid(int)); // no problem
const std::type_info& ti128(typeid(__int128_t));
const std::type_info& tu128(typeid(__uint128_t));

int main(){}

salmonj@drdblogin6.en.desres$ desres-cleanenv -m gcc/4.4.1-13/bin g++ -std=gnu++0x  typeid.cpp 
/tmp/ccKpEAiz.o:(.rodata+0x8): undefined reference to `typeinfo for __int128'
/tmp/ccKpEAiz.o:(.rodata+0x10): undefined reference to `typeinfo for unsigned __int128'
collect2: ld returned 1 exit status
salmonj@drdblogin6.en.desres$
Comment 1 Wolfgang Bangerth 2009-08-25 14:13:19 UTC
With current mainline, I just get these errors:

g/x> /home/bangerth/bin/x86/gcc-mainline/bin/c++ x.cc -std=c++0x
x.cc:4:36: error: '__int128_t' was not declared in this scope
x.cc:5:36: error: '__uint128_t' was not declared in this scope

What do I need to do to make these types available?
Comment 2 jsm-csl@polyomino.org.uk 2009-08-25 14:48:43 UTC
Subject: Re:  undefined reference to `typeinfo for __int128'

On Tue, 25 Aug 2009, bangerth at gmail dot com wrote:

> With current mainline, I just get these errors:
> 
> g/x> /home/bangerth/bin/x86/gcc-mainline/bin/c++ x.cc -std=c++0x
> x.cc:4:36: error: '__int128_t' was not declared in this scope
> x.cc:5:36: error: '__uint128_t' was not declared in this scope
> 
> What do I need to do to make these types available?

They are only available for 64-bit targets (more precisely, 64-bit targets 
other than PA; testcases use #if (defined(__LP64__) && !defined(__hppa__)) 
|| defined(_WIN64)).

Comment 3 Wolfgang Bangerth 2009-08-25 15:26:14 UTC
Confirmed with gcc4.2.1.
W.
Comment 4 Steve Ward 2011-04-14 15:29:20 UTC
This looks like a duplicate of #43622.
Comment 5 Paolo Carlini 2011-09-25 15:04:17 UTC

*** This bug has been marked as a duplicate of bug 43622 ***