Skip to content

Commit

Permalink
Sema: allow imaginary constants via GNU extension if UDL overloads no…
Browse files Browse the repository at this point in the history
…t present.

C++14 added user-defined literal support for complex numbers so that you can
write something like "complex<double> val = 2i". However, there is an existing
GNU extension supporting this syntax and interpreting the result as a _Complex
type.

This changes parsing so that such literals are interpreted in terms of C++14's
operators if an overload is present but otherwise falls back to the original
GNU extension.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303694 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
TNorthover committed May 23, 2017
1 parent b9f9e91 commit 5be8b93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2394,9 +2394,12 @@ void SelectionDAGBuilder::visitIndirectBr(const IndirectBrInst &I) {
}

void SelectionDAGBuilder::visitUnreachable(const UnreachableInst &I) {
if (DAG.getTarget().Options.TrapUnreachable)
errs() << "WARNING: trap\n";
if (DAG.getTarget().Options.TrapUnreachable) {
DAG.setRoot(
DAG.getNode(ISD::TRAP, getCurSDLoc(), MVT::Other, DAG.getRoot()));

}
}

void SelectionDAGBuilder::visitFSub(const User &I) {
Expand Down

0 comments on commit 5be8b93

Please sign in to comment.