New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 14585 - static const data memebers each with a initializer but not defined out of class body
Summary: static const data memebers each with a initializer but not defined out of cla...
Status: RESOLVED FIXED
Alias: None
Product: libc++
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: 3.2
Hardware: PC Linux
: P enhancement
Assignee: Howard Hinnant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-12 03:30 PST by Zhang Xiongpang
Modified: 2012-12-12 16:42 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments
test_files (2.28 KB, application/octet-stream)
2012-12-12 03:30 PST, Zhang Xiongpang
Details
patch_file (22.79 KB, patch)
2012-12-12 03:32 PST, Zhang Xiongpang
Details
CREDITS.patch (286 bytes, patch)
2012-12-12 16:41 PST, Zhang Xiongpang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zhang Xiongpang 2012-12-12 03:30:24 PST
Created attachment 9682 [details]
test_files

Last month, I used clang++3.2 + libcxx + libcxxabi compiling the testsuites of STLport-5.2.1 on linux, I found a problem involving some static const data memebers of class numeric_limits each with a initializer but not defined out of class body, so it caused link error: undefined reference to `std::__1::numeric_limits<int>::is_specialized'.

Later I reported it at clang developer forum:
http://clang-developers.42468.n3.nabble.com/libcxx-problem-involving-static-const-data-members-of-class-numeric-limits-td4028564.html

Now I find some other same bugs, it involved the following classes:
<chrono>:
    chrono::system_clock
    chrono::steady_clock
<limits>:
    numeric_limits
<__locale>:
    locale
    ctype_base
<locale>:
    moneypunct
<random>:
    linear_congruential_engine
    mersenne_twister_engine
    subtract_with_carry_engine
    discard_block_engine
    shuffle_order_engine
<regex>:
    basic_regex

I have written some test files in the attachment.
And a fixed patch file in another attachment later.
Comment 1 Zhang Xiongpang 2012-12-12 03:32:41 PST
Created attachment 9683 [details]
patch_file

This is a patch file.
Comment 2 Howard Hinnant 2012-12-12 13:01:26 PST
Thanks for the tests and patch.

Would you be willing to have your tests copyrighted by the libc++ MIT/University of Illinois copyright system?  This would involve you adding your name/info to CREDITS.TXT.
Comment 3 Howard Hinnant 2012-12-12 15:15:15 PST
Fix Committed revision 170026.

Really nice job on the patch.  I'd still like to see an update to CREDITS.TXT.

Thanks.
Comment 4 Zhang Xiongpang 2012-12-12 16:41:44 PST
Created attachment 9689 [details]
CREDITS.patch
Comment 5 Zhang Xiongpang 2012-12-12 16:42:59 PST
(In reply to comment #2)
> Thanks for the tests and patch.
> 
> Would you be willing to have your tests copyrighted by the libc++
> MIT/University of Illinois copyright system?  This would involve you adding
> your name/info to CREDITS.TXT.

I'm glad to have my tests copyrighted by the libc++ MIT/University of Illinois copyright system.