[cfe-commits] r123871 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/PR8884.cpp
Rafael Espindola
rafael.espindola at gmail.com
Wed Jan 19 18:26:25 PST 2011
Author: rafael
Date: Wed Jan 19 20:26:24 2011
New Revision: 123871
URL: http://llvm.org/viewvc/llvm-project?rev=123871&view=rev
Log:
Fix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
failed to find a case where an enum context would make a difference, but
found PR9007 on the way.
Added:
cfe/trunk/test/SemaCXX/PR8884.cpp
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=123871&r1=123870&r2=123871&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Jan 19 20:26:24 2011
@@ -5991,7 +5991,7 @@
// Find the context where we'll be declaring the tag.
// FIXME: We would like to maintain the current DeclContext as the
// lexical context,
- while (SearchDC->isRecord())
+ while (SearchDC->isRecord() || SearchDC->isTransparentContext())
SearchDC = SearchDC->getParent();
// Find the scope where we'll be declaring the tag.
Added: cfe/trunk/test/SemaCXX/PR8884.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/PR8884.cpp?rev=123871&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/PR8884.cpp (added)
+++ cfe/trunk/test/SemaCXX/PR8884.cpp Wed Jan 19 20:26:24 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only %s
+extern "C" {
+ class bar {
+ friend struct foo;
+ static struct foo& baz ();
+ };
+ struct foo {
+ void zed () {
+ bar::baz();
+ }
+ };
+}
More information about the cfe-commits
mailing list