[LLVMbugs] [Bug 20763] New: Asserts on valid with anonymous union member name being hidden by namespace member declaration

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 26 20:25:09 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20763

            Bug ID: 20763
           Summary: Asserts on valid with anonymous union member name
                    being hidden by namespace member declaration
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Asserts on valid with declaration in namespace following a using directive
bringing a member of an anonymous union with the same name into scope.

### SOURCE:
$ cat nsAnonUnion.cc 
namespace K {
   static union { int x; };
}

using namespace K;
int x;


### COMPILER INVOCATION AND OUTPUT:
$ clang -cc1 -x c++ -std=c++03 nsAnonUnion.cc 
clang: /build/clang/src/llvm/tools/clang/lib/AST/Decl.cpp:618:
clang::LinkageInfo getLVForNamespaceScopeDecl(const clang::NamedDecl*,
LVComputationKind): Assertion `!isa<IndirectFieldDecl>(D) && "Didn't expect an
IndirectFieldDecl!"' failed.
0  clang           0x0000000003c87265 llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x0000000003c874e2
2  clang           0x0000000003c86e88
3  libpthread.so.0 0x00007fa97f69a340
4  libc.so.6       0x00007fa97e8d6f79 gsignal + 57
5  libc.so.6       0x00007fa97e8da388 abort + 328
6  libc.so.6       0x00007fa97e8cfe36
7  libc.so.6       0x00007fa97e8cfee2
8  clang           0x00000000025e53dc
9  clang           0x00000000025e6e1c
10 clang           0x00000000025e6f0d
11 clang           0x00000000025e7126
12 clang           0x00000000025e62ef clang::NamedDecl::getLinkageInternal()
const + 29
13 clang           0x00000000013f4a1c
14 clang           0x00000000025e7d1e clang::NamedDecl::hasLinkage() const + 24
15 clang           0x00000000017582a6
16 clang           0x0000000001749775
clang::Sema::FilterLookupForScope(clang::LookupResult&, clang::DeclContext*,
clang::Scope*, bool, bool) + 143
17 clang           0x000000000175ae8e
clang::Sema::ActOnVariableDeclarator(clang::Scope*, clang::Declarator&,
clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&,
llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) + 7754
18 clang           0x000000000175700b
clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>) + 2965
19 clang           0x0000000001755cde
clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) + 80
20 clang           0x000000000160ca19
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) + 159
21 clang           0x000000000160c3d1
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1433
22 clang           0x00000000015fa967
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 1021
23 clang           0x00000000015faa57
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 189
24 clang           0x00000000015fa221
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2911
25 clang           0x00000000015f9678
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 538
26 clang           0x00000000015f2eea clang::ParseAST(clang::Sema&, bool, bool)
+ 602
27 clang           0x00000000010af8c4 clang::ASTFrontendAction::ExecuteAction()
+ 322
28 clang           0x00000000010af39f clang::FrontendAction::Execute() + 139
29 clang           0x00000000010799bd
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 721
30 clang           0x000000000103d1eb
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 993
31 clang           0x000000000102ad32 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 770
32 clang           0x0000000001037cbc
33 clang           0x00000000010380f0 main + 661
34 libc.so.6       0x00007fa97e8c1ec5 __libc_start_main + 245
35 clang           0x0000000001029369
Stack dump:
0.    Program arguments: clang -cc1 -x c++ -std=c++03 nsAnonUnion.cc 
1.    nsAnonUnion.cc:6:6: current parser token ';'
Aborted (core dumped)


### COMPILER VERSION INFO:
$ clang++ -v
clang version 3.6.0 (trunk 215824)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64

-- 
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/20140827/0daa02a5/attachment.html>


More information about the llvm-bugs mailing list