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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs