[Bug c++/89149] New: Out of bounds array access not detected as ill-formed in a constant expression context in some cases

2019-02-01 Thread yaghmour.shafik at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- Given the following C++ example: void foo() { constexpr char c1 = (&(&&quo

[Bug c++/64372] [DR1560] Gratuitous lvalue-to-rvalue conversion in conditional-expression with throw-expression operand

2018-12-28 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64372 --- Comment #11 from Shafik Yaghmour --- Bumping, it has been a while. I ran into this reviewing [diff.cpp11.expr] https://timsong-cpp.github.io/cppwp/n4659/diff.cpp11.expr and noticed the code in the example similar to the reduced sample fails

[Bug c++/87275] unsequenced writes not diagnosed in constant expression

2018-12-19 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87275 --- Comment #3 from Shafik Yaghmour --- Note, I have filed similar bugs for clang: https://bugs.llvm.org/show_bug.cgi?id=38420 and MSVC: https://developercommunity.visualstudio.com/content/problem/304122/unsequenced-modifications-of-variable-with

[Bug c++/88458] New: Conditional expression where the second and third operand are int and nullptr treated as ill-formed

2018-12-11 Thread yaghmour.shafik at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- Given the following code char* ch4 = true ? 0 : nullptr; and compiling with the following flags

[Bug c++/85867] New: Subscript operator applied to an temporary array results in an lvalue

2018-05-21 Thread yaghmour.shafik at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- This Stackoverflow question https://stackoverflow.com/q/33161003/1708801 provides the following code: using Y = int[10]; int

[Bug c/83433] Should -Wstrict-overflow=2 produce a diagnostic for abs(INT_MIN)

2017-12-14 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83433 --- Comment #3 from Shafik Yaghmour --- I still think it is awkwardly worded but your second point is valid about it only warning on comparisons. Please, feel free to close.

[Bug c/83433] New: Should -Wstrict-overflow=2 produce a diagnostic for abs(INT_MIN)

2017-12-14 Thread yaghmour.shafik at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- Given the following code: #include #include #include int main() { printf( "%d\n", abs(INT_MIN) ) ; } and comp

[Bug c++/69967] New: #pragma GCC diagnostic ignored being ignored for -Wunused-variable in some cases

2016-02-25 Thread yaghmour.shafik at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- Given the following example: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-var

[Bug c++/68604] typeid does not allow an id-expression that denotes a non-static data member

2015-12-01 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68604 --- Comment #2 from Shafik Yaghmour --- Wandbox has clang 3.8 and we can see that clang accepts this in C++11 mode: http://melpon.org/wandbox/permlink/IzawQ5DDLFyIyQNo but not in C++03 mode: http://melpon.org/wandbox/permlink/IzawQ5DDLFyIyQNo.

[Bug c++/68604] New: typeid does not allow an id-expression that denotes a non-static data member

2015-11-28 Thread yaghmour.shafik at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- Given the following simplified example from this Stackoverflow question http://stackoverflow.com/q/28053640/1708801

[Bug c++/68262] New: Ill-formed function pointer declaration acts as multi-line comment until ;

2015-11-09 Thread yaghmour.shafik at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- Given the following code: #include int main() { void (*) {} We could go on and on line after line

[Bug c++/55986] RHS of logical operators may render LHS unevaluated in constant-expression

2015-10-21 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55986 --- Comment #5 from Shafik Yaghmour --- It looks like this case from this Stackoverflow question http://stackoverflow.com/q/32920229/1708801 is possibly related: int main(int argc, char**) { constexpr int a = argc * 0; } gcc treats `argc *

[Bug c++/55986] RHS of logical operators may render LHS unevaluated in constant-expression

2015-07-29 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55986 Shafik Yaghmour changed: What|Removed |Added CC||yaghmour.shafik at gmail dot com

[Bug c++/66170] New: Bogus warning with -Wsign-conversion when using static_cast on an int

2015-05-15 Thread yaghmour.shafik at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- Given the following code: #include int main() { int length = 0; size_t n; n = static_cast(length

[Bug c++/65327] GCC rejects "constexpr volatile int i = 5;"

2015-03-05 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65327 Shafik Yaghmour changed: What|Removed |Added CC||yaghmour.shafik at gmail dot com

[Bug c++/65043] New: Expected narrowing conversion during list initialization of bool from double

2015-02-12 Thread yaghmour.shafik at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Given the following code form this stackoverflow question http://stackoverflow.com/q/27507361/1708801 : #include struct X { X(bool arg

[Bug c++/49813] [C++0x] sinh vs asinh vs constexpr

2014-12-31 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49813 Shafik Yaghmour changed: What|Removed |Added CC||yaghmour.shafik at gmail dot com

[Bug c++/62116] Allowing redeclaration of global variable x using ::x

2014-08-13 Thread yaghmour.shafik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62116 --- Comment #2 from Shafik Yaghmour --- I am happy to be mistaken here, but it seems like section 6.8 paragraph 1 applies, for example if we have the following: int(y) = 10; it is being treated as a declaration not a cast and further more secti

[Bug c++/62116] New: Allowing redeclaration of global variable x using ::x

2014-08-12 Thread yaghmour.shafik at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Given the following code: int x; int main() { int(::x); //does not compile int(::x + 2); //compiles } gcc 4.9 will compile it without an error while gcc 4.8.x and clang 3.4

[Bug c++/62110] New: Attempting to use template conversion operator in a contextual conversion

2014-08-12 Thread yaghmour.shafik at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Given the following code: class Var { public: operator int () const { return 0; } template operator T () const { return T

[Bug c++/60049] New: Right and left shift undefined behavior not an error in a constexpr

2014-02-03 Thread yaghmour.shafik at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com I expected the following code involving constexpr to generate errors since all the shifts invoke undefined behavior: int main() { constexpr int