Sema: Disallow taking the address of a bitfield coming from preincrement
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 31 Jul 2014 04:52:13 +0000 (04:52 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 31 Jul 2014 04:52:13 +0000 (04:52 +0000)
commit742424339afa29b52c55e40289c735cf7030aeaf
tree698f1b9ee76ddf5b60f0ac22024e284f4d5a35e1
parenta92687d6365f3bef67f23929c568262045f5b45b
Sema: Disallow taking the address of a bitfield coming from preincrement

Clang forgot that '++s.m' was a bitfield l-value and permit it's address
to be taken; this would crash at CodeGen-time.

Instead, propagate the object-kind when we see the prefix
increment/decrement.

This fixes PR20496.

Differential Revision: http://reviews.llvm.org/D4733

llvm-svn: 214386
clang/lib/Sema/SemaExpr.cpp
clang/test/CXX/drs/dr3xx.cpp