From a0bc07262be89b4ebeade9c7c966e972ec7b49f6 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 1 Jun 2012 00:02:08 +0000 Subject: Anonymous union members within a struct are now properly handled as an unevaluated field in C++11 mode. This fixes PR12866. llvm-svn: 157784 --- clang/test/SemaCXX/anonymous-union-cxx11.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 clang/test/SemaCXX/anonymous-union-cxx11.cpp (limited to 'clang/test') diff --git a/clang/test/SemaCXX/anonymous-union-cxx11.cpp b/clang/test/SemaCXX/anonymous-union-cxx11.cpp new file mode 100644 index 00000000000..8e682ebcda3 --- /dev/null +++ b/clang/test/SemaCXX/anonymous-union-cxx11.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -pedantic %s + +namespace PR12866 { + struct bar { + union { + int member; + }; + }; + + void foo( void ) { + (void)sizeof(bar::member); + } +} -- cgit v1.2.3