{"action":"created","issue":{"url":"https://api.github.com/repos/Ericsson/clang/issues/278","repository_url":"https://api.github.com/repos/Ericsson/clang","labels_url":"https://api.github.com/repos/Ericsson/clang/issues/278/labels{/name}","comments_url":"https://api.github.com/repos/Ericsson/clang/issues/278/comments","events_url":"https://api.github.com/repos/Ericsson/clang/issues/278/events","html_url":"https://github.com/Ericsson/clang/issues/278","id":293928930,"number":278,"title":"When importing a constructor declaration, its declaration context is not C++ record declaration","user":{"login":"martong","id":5887427,"avatar_url":"https://avatars0.githubusercontent.com/u/5887427?v=4","gravatar_id":"","url":"https://api.github.com/users/martong","html_url":"https://github.com/martong","followers_url":"https://api.github.com/users/martong/followers","following_url":"https://api.github.com/users/martong/following{/other_user}","gists_url":"https://api.github.com/users/martong/gists{/gist_id}","starred_url":"https://api.github.com/users/martong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martong/subscriptions","organizations_url":"https://api.github.com/users/martong/orgs","repos_url":"https://api.github.com/users/martong/repos","events_url":"https://api.github.com/users/martong/events{/privacy}","received_events_url":"https://api.github.com/users/martong/received_events","type":"User","site_admin":false},"labels":[{"id":814013038,"url":"https://api.github.com/repos/Ericsson/clang/labels/ASTImporter","name":"ASTImporter","color":"f0f477","default":false}],"state":"open","locked":false,"assignee":{"login":"baloghadamsoftware","id":7555258,"avatar_url":"https://avatars0.githubusercontent.com/u/7555258?v=4","gravatar_id":"","url":"https://api.github.com/users/baloghadamsoftware","html_url":"https://github.com/baloghadamsoftware","followers_url":"https://api.github.com/users/baloghadamsoftware/followers","following_url":"https://api.github.com/users/baloghadamsoftware/following{/other_user}","gists_url":"https://api.github.com/users/baloghadamsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/baloghadamsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baloghadamsoftware/subscriptions","organizations_url":"https://api.github.com/users/baloghadamsoftware/orgs","repos_url":"https://api.github.com/users/baloghadamsoftware/repos","events_url":"https://api.github.com/users/baloghadamsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/baloghadamsoftware/received_events","type":"User","site_admin":false},"assignees":[{"login":"baloghadamsoftware","id":7555258,"avatar_url":"https://avatars0.githubusercontent.com/u/7555258?v=4","gravatar_id":"","url":"https://api.github.com/users/baloghadamsoftware","html_url":"https://github.com/baloghadamsoftware","followers_url":"https://api.github.com/users/baloghadamsoftware/followers","following_url":"https://api.github.com/users/baloghadamsoftware/following{/other_user}","gists_url":"https://api.github.com/users/baloghadamsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/baloghadamsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baloghadamsoftware/subscriptions","organizations_url":"https://api.github.com/users/baloghadamsoftware/orgs","repos_url":"https://api.github.com/users/baloghadamsoftware/repos","events_url":"https://api.github.com/users/baloghadamsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/baloghadamsoftware/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Ericsson/clang/milestones/42","html_url":"https://github.com/Ericsson/clang/milestone/42","labels_url":"https://api.github.com/repos/Ericsson/clang/milestones/42/labels","id":3092277,"number":42,"title":"febr 9","description":"","creator":{"login":"dkrupp","id":8030953,"avatar_url":"https://avatars3.githubusercontent.com/u/8030953?v=4","gravatar_id":"","url":"https://api.github.com/users/dkrupp","html_url":"https://github.com/dkrupp","followers_url":"https://api.github.com/users/dkrupp/followers","following_url":"https://api.github.com/users/dkrupp/following{/other_user}","gists_url":"https://api.github.com/users/dkrupp/gists{/gist_id}","starred_url":"https://api.github.com/users/dkrupp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkrupp/subscriptions","organizations_url":"https://api.github.com/users/dkrupp/orgs","repos_url":"https://api.github.com/users/dkrupp/repos","events_url":"https://api.github.com/users/dkrupp/events{/privacy}","received_events_url":"https://api.github.com/users/dkrupp/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":1,"state":"open","created_at":"2018-02-06T09:07:21Z","updated_at":"2018-02-06T13:43:42Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-02-02T15:39:15Z","updated_at":"2018-02-07T14:00:02Z","closed_at":null,"author_association":"NONE","body":"Top of stack trace:\r\n\r\nclang-5.0: /home/edmbalo/ctu/llvm/include/llvm/Support/Casting.h:255: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = clang::CXXRecordDecl; Y = clang::DeclContext; typename llvm::cast_retty<X, Y*>::ret_type = clang::CXXRecordDecl*]: Assertion `isa(Val) && \"cast() argument of incompatible type!\"' failed.\r\n#0 0x00007fbacec45fd9 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/edmbalo/ctu/llvm/lib/Support/Unix/Signals.inc:398:0\r\n#1 0x00007fbacec4606a PrintStackTraceSignalHandler(void*) /home/edmbalo/ctu/llvm/lib/Support/Unix/Signals.inc:462:0\r\n#2 0x00007fbacec444b0 llvm::sys::RunSignalHandlers() /home/edmbalo/ctu/llvm/lib/Support/Signals.cpp:49:0\r\n#3 0x00007fbacec45971 SignalHandler(int) /home/edmbalo/ctu/llvm/lib/Support/Unix/Signals.inc:252:0\r\n#4 0x00007fbacb577cb0 (/lib/x86_64-linux-gnu/libc.so.6+0x36cb0)\r\n#5 0x00007fbacb577c37 gsignal /build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0\r\n#6 0x00007fbacb57b028 abort /build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0\r\n#7 0x00007fbacb570bf6 __assert_fail_base /build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0\r\n#8 0x00007fbacb570ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)\r\n#9 0x00007fbac71a93ea llvm::cast_retty<clang::CXXRecordDecl, clang::DeclContext*>::ret_type llvm::cast<clang::CXXRecordDecl, clang::DeclContext>(clang::DeclContext*) /home/edmbalo/ctu/llvm/include/llvm/Support/Casting.h:257:0\r\n#10 0x00007fbac71bfae8 clang::ASTNodeImporter::VisitFunctionDecl(clang::FunctionDecl*) /home/edmbalo/ctu/llvm/tools/clang/lib/AST/ASTImporter.cpp:2447:0\r\n#11 0x00007fbac71c06e9 clang::ASTNodeImporter::VisitCXXMethodDecl(clang::CXXMethodDecl*) /home/edmbalo/ctu/llvm/tools/clang/lib/AST/ASTImporter.cpp:2574:0\r\n#12 0x00007fbac71c070f clang::ASTNodeImporter::VisitCXXConstructorDecl(clang::CXXConstructorDecl*) /home/edmbalo/ctu/llvm/tools/clang/lib/AST/ASTImporter.cpp:2578:0"},"comment":{"url":"https://api.github.com/repos/Ericsson/clang/issues/comments/363777099","html_url":"https://github.com/Ericsson/clang/issues/278#issuecomment-363777099","issue_url":"https://api.github.com/repos/Ericsson/clang/issues/278","id":363777099,"user":{"login":"baloghadamsoftware","id":7555258,"avatar_url":"https://avatars0.githubusercontent.com/u/7555258?v=4","gravatar_id":"","url":"https://api.github.com/users/baloghadamsoftware","html_url":"https://github.com/baloghadamsoftware","followers_url":"https://api.github.com/users/baloghadamsoftware/followers","following_url":"https://api.github.com/users/baloghadamsoftware/following{/other_user}","gists_url":"https://api.github.com/users/baloghadamsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/baloghadamsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baloghadamsoftware/subscriptions","organizations_url":"https://api.github.com/users/baloghadamsoftware/orgs","repos_url":"https://api.github.com/users/baloghadamsoftware/repos","events_url":"https://api.github.com/users/baloghadamsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/baloghadamsoftware/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T14:00:02Z","updated_at":"2018-02-07T14:00:02Z","author_association":"NONE","body":"The crash happens the following way:\r\n1. Function in C++ source file invokes function in C file\r\n2. `ASTImporter` imports function from C file which uses variadic arguments\r\n3. Structure `__va_list_tag`  is imported which was created by `ASTContext` as `RecordDecl`.\r\n4. Function in C++ source file invokes function in C++ file\r\n5. `ASTImporter` imports function from C++ file which declares variable of type  `__builtin_va_list`\r\n6. `CXXConstructExpr` is imported, therefore the definition of the constructor is also imported\r\n7. Structure `__va_list_tag`  (created by `ASTContext` as `CXXRecordDecl`) is **not** imported because `RecordDecl` with the same name exists.\r\n8. Implicitly generated `CXXConstructorDecl` cannot be successfully imported because `RecordDecl` cannot be casted to `CXXRecordDecl`.\r\n"}}
{"actor":{"display_login":"baloghadamsoftware"}}