[llvm-bugs] [Bug 27122] New: Assertion `InitE && "No initialization expression?"' failed.
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Mar 29 16:10:20 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=27122
Bug ID: 27122
Summary: Assertion `InitE && "No initialization expression?"'
failed.
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: rtrieu at google.com
CC: Kaelyn.Alexi at gmail.com, llvm-bugs at lists.llvm.org
Classification: Unclassified
$ cat test.cpp
namespace ns {
void Function(int format) { }
void Function(int format, int a) { }
void Function(const int num)
__attribute__((enable_if(num != 0, "Check num0"), unavailable("Bad num 0")));
void Function(const int num, const int a0)
__attribute__((enable_if(num != 1, "Check num1"), unavailable("Bad num 1")));
} // namespace ns
using ns::Function;
void Run() {
Functioon(0);
}
$ clang -fsyntax-only test.cpp
test.cpp:15:3: error: use of undeclared identifier 'Functioon'; did you mean
'Function'?
Functioon(0);
^~~~~~~~~
Function
test.cpp:13:11: note: 'Function' declared here
using ns::Function;
^
test.cpp:15:3: error: 'Function' is unavailable: Bad num 1
Functioon(0);
^
test.cpp:8:6: note: 'Function' has been explicitly marked unavailable here
void Function(const int num, const int a0)
^
clang-3.5: ../tools/clang/lib/Sema/SemaInit.cpp:7827: ExprResult
clang::Sema::PerformCopyInitialization(const clang::InitializedEntity &,
clang::SourceLocation, ExprResult, bool, bool): Assertion `InitE && "No
initialization expression?"' failed.
Functioon is typo-corrected to Function. However, with the using declaration
and overloaded Function, the LookupResult typo-corrects to "void Function(const
int num, const int a0)" and causes the assertion failure.
--
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/20160329/36ec4cdc/attachment-0001.html>
More information about the llvm-bugs
mailing list