]> granicus.if.org Git - clang/commit
C++11 [class.ctor]p5 says that
authorDouglas Gregor <dgregor@apple.com>
Fri, 24 Feb 2012 21:25:53 +0000 (21:25 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 24 Feb 2012 21:25:53 +0000 (21:25 +0000)
commit221c27f0d34c5938d84bbb8fafe1c3e3f1f87f2e
tree8acd7f363643bc9241cc57f625df4a7decfab4e7
parent62348f041adccdf9376f5c355ed64ecbce0b4f0f
C++11 [class.ctor]p5 says that
  A defaulted default constructor for a class X is defined as deleted if [...]
    -  X is a union and all of its variant members are of const-qualified type.

A pedantic reading therefore says that

 union X { };

has a deleted default constructor, which is both silly and almost
certainly unintended. Pretend as if this this read

    - X is a union with one or more variant members, and all of its
      variant members are of const-qualified type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151394 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/cxx0x-deleted-default-ctor.cpp