https://llvm.org/bugs/show_bug.cgi?id=24255
Bug ID: 24255
Summary: Extraneous array-bounds errors on templated
constructor
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 14644
--> https://llvm.org/bugs/attachment.cgi?id=14644&action=edit
Test case
Given the attached code, Clang compiles it with no diagnostics (as expected),
but if I introduce an unrelated syntax error, an out-of-bounds warning is
emitted:
$ clang++ -c foo.cc -DEXTRA_ERROR
foo.cc:13:5: error: use of undeclared identifier 'undefined_variable'
undefined_variable++;
^
foo.cc:6:33: warning: array index 2 is past the end of the array (which
contains 2 elements) [-Warray-bounds]
str[2] == '*') {}
^ ~
foo.cc:16:7: note: in instantiation of function template specialization
'Foo::Foo<2>' requested here
Foo f1("*");
^
foo.cc:4:7: note: array 'str' declared here
Foo(const char(&str)[N])
^
1 warning and 1 error generated.
I'm expecting the warning to be emitted even without the syntax error (or not
at all).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs