Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
a9cc24b6
Commit
a9cc24b6
authored
8 years ago
by
Frederich Munch
Committed by
Axel Naumann
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Don’t import UsingDecl or UsingShadowDecl. Fixes atexit test failure on gcc on OS X.
parent
1c19e0ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interpreter/cling/lib/Interpreter/ExternalInterpreterSource.cpp
+28
-6
28 additions, 6 deletions
...reter/cling/lib/Interpreter/ExternalInterpreterSource.cpp
with
28 additions
and
6 deletions
interpreter/cling/lib/Interpreter/ExternalInterpreterSource.cpp
+
28
−
6
View file @
a9cc24b6
...
...
@@ -96,13 +96,35 @@ namespace cling {
DeclarationName
&
parentDeclName
,
const
DeclContext
*
childCurrentDeclContext
)
{
// Don't do the import if we have a Function Template.
// Not supported by clang.
// FIXME: This is also a temporary check. Will be de-activated
// once clang supports the import of function templates.
if
(
declToImport
->
isFunctionOrFunctionTemplate
()
&&
declToImport
->
isTemplateDecl
())
// Don't do the import if we have a Function Template or using decls. They
// are not supported by clang.
// FIXME: These are temporary checks and should be de-activated once clang
// supports their import.
if
((
declToImport
->
isFunctionOrFunctionTemplate
()
&&
declToImport
->
isTemplateDecl
())
||
dyn_cast
<
UsingDecl
>
(
declToImport
)
||
dyn_cast
<
UsingShadowDecl
>
(
declToImport
))
{
#ifndef NDEBUG
// DiagnosticsTrap isn't working here!
DiagnosticsEngine
&
Diags
=
m_Importer
->
getFromContext
().
getDiagnostics
();
const
bool
OwnClient
=
Diags
.
ownsClient
();
std
::
unique_ptr
<
DiagnosticConsumer
>
Prev
=
Diags
.
takeClient
();
DiagnosticConsumer
Trap
;
Diags
.
setClient
(
&
Trap
,
false
);
assert
((
!
Trap
.
getNumErrors
()
&&
m_Importer
->
Import
(
declToImport
)
==
nullptr
&&
Trap
.
getNumErrors
()
!=
0
)
&&
"Import using worked!"
);
assert
(
Trap
.
getNumErrors
()
==
1
&&
"Import caused multiple errors"
);
Diags
.
setClient
(
Prev
.
get
(),
OwnClient
);
Prev
.
release
();
#if LLVM_VERSION_MAJOR >= 4
// In LLVM 4 the test above still works, but the errors generated are
// still propogated...So just reset the Diags.
Diags
.
Reset
(
true
);
#endif
#endif
return
;
}
if
(
Decl
*
importedDecl
=
m_Importer
->
Import
(
declToImport
))
{
if
(
NamedDecl
*
importedNamedDecl
=
llvm
::
dyn_cast
<
NamedDecl
>
(
importedDecl
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment