[cfe-dev] Initlist lifetime extension error

suyog sarda sardask01 at gmail.com
Thu Oct 17 05:27:03 PDT 2013


I was testing a case of extension of lifetime of init list. The Test Case
is as follow :

 *#include <initializer_list>**
extern "C" void abort();*
*bool ok;**
bool do_throw;**
struct A {**
A(int) {**
if (do_throw) throw 42;**
}**
~A() {**
if (!ok) abort();**
}**
};**

typedef std::initializer_list<A> AL;*
***typedef std::initializer_list<AL> AL2;**
typedef std::initializer_list<AL2> AL3;**

struct B {**
AL al;**
const AL& alr;**
};**

int main(int argc, const char** argv) {*
* ** B b = {{5,6},{7,8}};**
} *

 Clang 3.3 throws error 'reference to type 'const AL' (aka 'const
initializer_list<A>') could not bind to an rvalue of type 'int' '. This is
because lifetime of init list was not extended. This issue is fixed in
trunk version and it does not throw any error. I was trying to backport the
change in 3.3. I have identified 5 major revisions - r183283, r183594,
r183859, r183872 and r185117. I applied the changes and the Test Case
passes in the patched code. However, when i run regression test on patched
code, the test gets stuck at 99% at
unittest/Transforms/Utils/UtilsTests/IntegerDivision.Urem . Can someone
please point out and confirm the correct revision number. Also, why the
regression test is getting stuck and not completing?

-- 
With regards,
Suyog Sarda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131017/51c88fd4/attachment.html>


More information about the cfe-dev mailing list