https://bugs.llvm.org/show_bug.cgi?id=52297

            Bug ID: 52297
           Summary: interesting difference in do_get behavior between
                    libc++ and other libraries.
           Product: libc++
           Version: 11.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Standards Issues
          Assignee: unassignedclangb...@nondot.org
          Reporter: edward.vo...@hpe.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

Created attachment 25391
  --> https://bugs.llvm.org/attachment.cgi?id=25391&action=edit
Small program that shows the issue.

The attached small program shows a difference in the behavior of libc++ do_get
when a class overrides the standard do_get.   Here an overriding do_get for
bool types calls the base class do_get.   With libc++ that call will call the
long do_get viritual function in the overriding class.   Other libraries (gnu,
Visual Studio) will call the base class long do_get.

In reading the Standard, it's not clear to me who is correct.  This is why I've
posted this as a standards issue.

Here is a cut/paste from a Cygwin session:


VogelEd@XLB3502Q4E ~/temp
$ clang++ -o a.out t1.cpp

VogelEd@XLB3502Q4E ~/temp
$ ./a.out
In bool do_get
Returning from bool do_get

VogelEd@XLB3502Q4E ~/temp
$ clang++ -o a.out -stdlib=libc++ t1.cpp

VogelEd@XLB3502Q4E ~/temp
$ ./a.out
In bool do_get
In long do_get
Returning from long do_get
Returning from bool do_get


The attached reproducer is a greatly reduced and modified version of one of
the runtime library tests I use to test one of our HPE runtimes.

Probably not a big deal, but this difference in behavior could cause customer
confusion.

Thank you for your time,

Ed Vogel

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to