[LLVMbugs] [Bug 6536] C++ scope checking too aggressive with struct with trivial constructor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Mar 7 18:52:28 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=6536

Douglas Gregor <dgregor at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Douglas Gregor <dgregor at apple.com> 2010-03-07 20:52:27 CST ---
(In reply to comment #2)
> It only gets rejected if you compile it as c++.  That said, I think this is a
> AST construction bug, the AST looks like this:
> 
> void a() (CompoundStmt 0x1036181c0 <t.cc:2:10, col:40>
>   (GotoStmt 0x1036180a0 <col:12, col:17> 'out':0x103618070)
>   (DeclStmt 0x103617050 <col:22, col:25>
>     0x1036180f0 "struct A x =
>       (CXXConstructExpr 0x103618160 <col:24> 'struct A''void (void)')"
>   (LabelStmt 0x103618070 <col:27, col:32> 'out'
>     (ReturnStmt 0x1036181a0 <col:32>)))
> 
> 
> I'm pretty sure that x should not be initialized.

Apparently, it should be initialized in C++0x but not in C++98/03! In C++0x, it
appears that we do have an initializer (which calls the trivial default
constructor), but that constructor doesn't actually do anything. 

Fixed for C++98/03 in r97928. Fixing it for '0x isn't a priority now, but I've
left a FIXME there as a reminder.

-- 
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