[llvm-bugs] [Bug 26076] New: dllexport vs template instantiation, nested class, and in-class initialization
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Fri Jan  8 07:54:50 PST 2016
    
    
  
https://llvm.org/bugs/show_bug.cgi?id=26076
            Bug ID: 26076
           Summary: dllexport vs template instantiation, nested class, and
                    in-class initialization
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified
>From crbug.com/575700:
  struct LayerSelectionBound;
  template <typename> struct Selection {};
  typedef Selection<LayerSelectionBound> LayerSelection;
  struct LayerImpl;
  struct __declspec(dllexport) LayerTreeImpl {
    struct __declspec(dllexport) ElementLayers {
      LayerImpl *main = nullptr;
    };
    LayerSelection foo;
  };
$ bin/clang -target i686-pc-win32 -c /tmp/a.cc 
/tmp/a.cc:8:16: error: cannot use defaulted default constructor of
'ElementLayers' within 'LayerTreeImpl' outside of member functions because
'main' has an
      initializer
    LayerImpl *main = nullptr;
               ^
/tmp/a.cc:10:18: note: in instantiation of template class
'Selection<LayerSelectionBound>' requested here
  LayerSelection foo;
                 ^
/tmp/a.cc:7:32: note: implicit default constructor for
'LayerTreeImpl::ElementLayers' first required here
  struct __declspec(dllexport) ElementLayers {
                               ^
/tmp/a.cc:7:21: note: due to 'ElementLayers' being dllexported
  struct __declspec(dllexport) ElementLayers {
                    ^
1 error generated.
PR23542 was the bug for dllexport vs in-class initializers in general.
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160108/b4b1e4c3/attachment.html>
    
    
More information about the llvm-bugs
mailing list