[llvm-bugs] [Bug 44925] New: Assertion `Access == AS_private || Access == AS_protected' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Feb 15 11:13:42 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=44925

            Bug ID: 44925
           Summary: Assertion `Access == AS_private || Access ==
                    AS_protected' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: changochen1 at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

POC:
---
# 1 "<built-in>"
# 1 "./test1.c"
struct {: ( struct a: a
---


Run script:
---
# Crash reproducer for clang version 11.0.0
(https://github.com/llvm/llvm-project.git
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "--driver-mode=g++" "-x" "c++" "-o" "tm" "./test1.c"
# Original command:  "/data/rxz226/llvm-project/bld/bin/clang-11" "-cc1"
"-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-resource-dir"
"/data/rxz226/llvm-project/bld/lib/clang/11.0.0" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/x86_64-linux-gnu/c++/7.4.0"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/x86_64-linux-gnu/c++/7.4.0"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/data/rxz226/llvm-project/bld/lib/clang/11.0.0/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdeprecated-macro" "-fdebug-compilation-dir"
"/home/rxz226/c_reduce" "-ferror-limit" "19" "-fmessage-length" "0"
"-fgnuc-version=4.2.1" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-faddrsig" "-o"
"/tmp/test1-9d592a.o" "-x" "c++" "./test1.c"
 "/data/rxz226/llvm-project/bld/bin/clang-11" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-fdeprecated-macro" "-ferror-limit" "19"
"-fmessage-length" "0" "-fgnuc-version=4.2.1" "-fobjc-runtime=gcc"
"-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-faddrsig" "-x" "c++" "test1-bdd5a6.cpp"
---


Stack dump:
---
Stack dump:
0.      Program arguments: /home/rxz226/llvm-project/bld/bin/clang++ -x c++ -o
tm ./test1.c
1.      <eof> parser at end of file
2.      ./test1.c:1:1: parsing struct/union/class body '(anonymous)'
3.      ./test1.c:1:13: parsing struct/union/class body '(anonymous struct)::a'
 #0 0x000000000511679b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:0
 #1 0x000000000511682e PrintStackTraceSignalHandler(void*)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:0
 #2 0x00000000051145b6 llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:68:0
 #3 0x0000000005115fd7 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:0
 #4 0x000000000501be1f (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:0
 #5 0x000000000501c2fe CrashRecoverySignalHandler(int)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:362:0
 #6 0x00007f7c12acc390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #7 0x00007f7c117db428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #8 0x00007f7c117dd02a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #9 0x00007f7c117d3bd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
#10 0x00007f7c117d3c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#11 0x0000000007b440e3 HasAccess(clang::Sema&, (anonymous
namespace)::EffectiveContext const&, clang::CXXRecordDecl const*,
clang::AccessSpecifier, (anonymous namespace)::AccessTarget const&)
/home/rxz226/llvm-project/clang/lib$
Sema/SemaAccess.cpp:738:0
#12 0x0000000007b45a51 IsAccessible(clang::Sema&, (anonymous
namespace)::EffectiveContext const&, (anonymous namespace)::AccessTarget&)
/home/rxz226/llvm-project/clang/lib/Sema/SemaAccess.cpp:1356:0
#13 0x0000000007b45d62 CheckEffectiveAccess(clang::Sema&, (anonymous
namespace)::EffectiveContext const&, clang::SourceLocation, (anonymous
namespace)::AccessTarget&)
/home/rxz226/llvm-project/clang/lib/Sema/SemaAccess.cpp:1415$
0
#14 0x0000000007b45f56 CheckAccess(clang::Sema&, clang::SourceLocation,
(anonymous namespace)::AccessTarget&)
/home/rxz226/llvm-project/clang/lib/Sema/SemaAccess.cpp:1459:0
#15 0x0000000007b47da0 clang::Sema::CheckLookupAccess(clang::LookupResult
const&) /home/rxz226/llvm-project/clang/lib/Sema/SemaAccess.cpp:1870:0
#16 0x0000000007a3691b clang::LookupResult::diagnose()
/home/rxz226/llvm-project/clang/include/clang/Sema/Lookup.h:699:0
#17 0x0000000007a36787 clang::LookupResult::~LookupResult()
/home/rxz226/llvm-project/clang/include/clang/Sema/Lookup.h:229:0
#18 0x0000000007c2b7e0 clang::Sema::getTypeName(clang::IdentifierInfo const&,
clang::SourceLocation, clang::Scope*, clang::CXXScopeSpec*, bool, bool,
clang::OpaquePtr<clang::QualType>, bool, bool, bool, clang::IdentifierInfo**)
/home/rxz226/llvm-project/clang/lib/Sema/SemaDecl.cpp:340:0
#19 0x0000000007a41c37
clang::Parser::ParseBaseTypeSpecifier(clang::SourceLocation&,
clang::SourceLocation&)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:1217:0
#20 0x0000000007a44b26 clang::Parser::ParseBaseSpecifier(clang::Decl*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:2121:0
#21 0x0000000007a447ae clang::Parser::ParseBaseClause(clang::Decl*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:2043:0
#22 0x0000000007a4986e
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) /home/rxz226/llvm-project/clang/lib/Parse/Pa$
seDeclCXX.cpp:3273:0
#23 0x0000000007a442a1
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, c$
ang::Parser::ParsedAttributesWithRange&)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:1960:0
#24 0x0000000007a258ec
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) /home/rxz2$
6/llvm-project/clang/lib/Parse/ParseDecl.cpp:3935:0
---

-- 
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/20200215/0d563b20/attachment-0001.html>


More information about the llvm-bugs mailing list